Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
475
Positioning 2 webDialogs (One beside the other one)
posted

Normal 0 false false false EN-GB X-NONE X-NONE MicrosoftInternetExplorer4

Hi

   I have two webdialog, but I want to separate them like in two columns. I mean one beside another one.

 I did that by  specifying the attribute “Left”, but base in one specific resolutions. When I change the resolution they do not look centered in the screen because the attribute “left” is not relative to the resolution of the screen.

There is an attribute “InitialLocation” that center the webdialog, but I cannot use it because my intention is having two webdialogs (one beside another one) of 50% size of the screen with the same “Top” value but one beside another one.

How could I do this? Has someone done this before?

 Regards

Jorge From Applied Network Solutions

Parents
No Data
Reply
  • 24497
    Suggested Answer
    posted

    Hi Jorge,

    I can suggest you to set InitialLocation to centered, process Loaded client event and shift locations of dialog to desired location.

    Below is example for you:

    <script type="text/javascript">
    function fixLocation(dialog, evtArgs)
    {
     var elem = dialog.get_element();
     var left = parseInt(elem.style.left), width = parseInt(elem.style.width) >> 1;
     if(dialog.get_id() == 'WebDialogWindow1')
      left += width + 1;
     else
      left -= width + 1;
     if('' + left != 'NaN')
      elem.style.left = left + 'px';
    }
    </script>
    <ig:WebDialogWindow ID="WebDialogWindow1" runat="server" Height="200px" Width="200px" InitialLocation="Centered">
     <ClientEvents Loaded="fixLocation" />
    </ig:WebDialogWindow>
    <ig:WebDialogWindow ID="WebDialogWindow2" runat="server" Height="200px" Width="200px" InitialLocation="Centered">
     <ClientEvents Loaded="fixLocation" />
    </ig:WebDialogWindow>

     

Children
No Data