radWindow modal="true" causes horizontal scrollbar in parentWindow

5 posts, 1 answers
  1. Paul J
    Paul J avatar
    101 posts
    Member since:
    Nov 2008

    Posted 02 Nov 2009 Link to this post

    I have a page that displays a radWindow. If modal is set to "true" it displays a horizontal scrollbar on my parent page. if set to "false", it doesn't.

    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"
        <script type="text/javascript"
     
     function ShowWindow() 
                {                    
            
              var wnd = window.radopen("window.aspx", "win");      
                          wnd.restore(); 
                      wnd.setSize(document.body.scrollWidth-170,document.body.scrollHeight+180); 
                       wnd.center();            
                } 
                 
            </script> 
        </telerik:RadCodeBlock> 
         
     
                            <asp:Button ID="button" runat="server" Text="Show" CssClass="button" OnClientClick="ShowWindow();return false;"/> 
                   
         
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server" style="overflow:hidden;"
            <Windows> 
                <telerik:RadWindow ID="win" VisibleStatusbar="false" KeepInScreenBounds="true"  
                DestroyOnClose="false" runat="server" InitialBehaviors="Close,Move,Resize" Behaviors="Close,Move,Resize"  
                ShowContentDuringLoad="true" Skin="Simple" Overlay="true" Modal="true" Title="Window"
                </telerik:RadWindow> 
            </Windows> 
             
        </telerik:RadWindowManager> 

    I narrowed this down to probably an issue with the width and height of the ModalOverlay. because if I add the following styles,

     .TelerikModalOverlay    
     {     
      width:100% !important; 
      height:100% !important; 
     }  


     it eliminates the scrollbars on the parent page, however, causes strange issues when then moving the radWindow from its default position (i.e. the widthand height of the Modal Overlay no longer reach the bounds of the parent page if the radWindows is moved around)


    Any ideas on how to fix this one way or another?
  2. Paul J
    Paul J avatar
    101 posts
    Member since:
    Nov 2008

    Posted 02 Nov 2009 Link to this post

    Forgot to mention that if i set DestroyOnClose to false (while not using the mentioned style fixes), when the window opens initially, the horizontal scrollbar is there, but if I close and then open it again, it's no longer there.

    strange if you ask me.
  3. Answer
    Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 03 Nov 2009 Link to this post

    Hello Paul J,

    In your case, I would suggest not to set the modality of the window before sizing it - this is the reason why the scrollbars appear. Remove the modal property from the declaration and set it dynamically when you open the window.
    e.g.
    function ShowWindow()
    {
     
        var wnd = window.radopen("window.aspx", "win");
        wnd.restore();
        wnd.setSize(document.body.scrollWidth - 170, document.body.scrollHeight + 180);
        wnd.set_modal(true);
        wnd.center();
    }


    Regards,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  4. Paul J
    Paul J avatar
    101 posts
    Member since:
    Nov 2008

    Posted 03 Nov 2009 Link to this post

    Worked like a charm. Thanks Georgi ! The little things always get me ;)
  5. Camilo
    Camilo avatar
    8 posts
    Member since:
    Apr 2007

    Posted 27 Dec 2010 Link to this post

    In addition to what is mentioned, personally probe with:
    overflowhidden !important;

    Quedando así:

    .TelerikModalOverlay
    {
        width99.9% !important;
        height100% !important;
        overflowhidden !important;
    }
Back to Top