Window AutoSize and Form Decorator

8 posts, 0 answers
  1. Paul Mc
    Paul Mc avatar
    32 posts
    Member since:
    Sep 2007

    Posted 05 Jun 2009 Link to this post

    Hi

    We have a simple page which is displayed in a rad window containing a two column html table and a command button.  The rad window is set to autosize.

    When we add a Form Decorator to the page the window resizes incorrectly and adds scroll bars.

    Is there something we have overlooked?

    Below is a simple example of the two pages we have.

    Default.aspx
    <html xmlns="http://www.w3.org/1999/xhtml">  
        <head runat="server">  
            <title></title>  
        </head> 
          
        <body> 
            <form id="form1" runat="server">  
              
                <telerik:RadScriptManager ID="RadScriptManager1" runat="server">  
                </telerik:RadScriptManager> 
     
                <telerik:RadWindow ID="RadWindow1" runat="server" NavigateUrl="Default2.aspx" AutoSize="true" VisibleOnPageLoad="true">  
                </telerik:RadWindow> 
              
            </form> 
        </body> 
    </html> 
     

    Default2.aspx
    <html xmlns="http://www.w3.org/1999/xhtml">  
        <head runat="server">  
            <title></title>  
        </head> 
     
     
        <body> 
            <form id="form1" runat="server">  
                <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>   
                <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" /> 
                  
                <asp:Button ID="Button2" runat="server" Text="Button" /> 
                <table> 
                    <tr> 
                        <td><asp:Label ID="Label1" runat="server" Text="Label"></asp:Label></td>  
                        <td><asp:TextBox ID="TextBox1" runat="server"></asp:TextBox></td>  
                    </tr>   
                    <tr> 
                        <td><asp:Label ID="Label2" runat="server" Text="Label"></asp:Label></td>  
                        <td><asp:TextBox ID="TextBox2" runat="server"></asp:TextBox></td>  
                    </tr> 
                    <tr> 
                        <td><asp:Label ID="Label3" runat="server" Text="Label"></asp:Label></td>  
                        <td><asp:TextBox ID="TextBox3" runat="server"></asp:TextBox></td>  
                    </tr> 
                </table> 
            </form> 
        </body> 
    </html> 

    Thanks in advance.

  2. Martin
    Admin
    Martin avatar
    585 posts

    Posted 05 Jun 2009 Link to this post

    Hi Paul Mc,

    According to the code you've posted, your page is in quirks mode, i.e. - it is missing a doctype definition, which is most probably the cause for the problem you are experiencing.

    Our controls, as well as the entire ASP.NET AJAX framework are designed and developed to perform best in standards compliance mode, and it is recommended that the page is xhtml, unless quirks mode is required, for example - in old content management systems, where developers cannot add a doctype.

    Please, add a valid DTD to your page, and if the problem persists, send us a sample project, along with your custom styles and layout so we can think of a solution.

    Have a great weekend,
    Martin Ivanov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Paul Mc
    Paul Mc avatar
    32 posts
    Member since:
    Sep 2007

    Posted 05 Jun 2009 Link to this post

    Hi Martin.

    Sorry, i dont know why i didnt cut and paste that part of the code.  The code on my pages does have the doctype definition on them.  Here is the examples from the two pages:

    Default.aspx
    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %> 
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
     

    Default2.aspx
    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="Default2" %> 
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
     

    In the project I have created for this demonstraton, i dont have any css or any additional code behind.  You should be able to reproduce the problem by creating a blank website with two web pages and simply copying the html in by below examples to each page respectively.

    Hope this helps to reproduce the problem.
  5. Martin
    Admin
    Martin avatar
    585 posts

    Posted 08 Jun 2009 Link to this post

    Hi Paul Mc,

    As you can see from the screenshots, the scrollbars are not caused by the presence of RadFormDecorator. Most probably this behavior is due to the table layout you have used.

    Kind regards,
    Martin Ivanov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  6. Paul Mc
    Paul Mc avatar
    32 posts
    Member since:
    Sep 2007

    Posted 08 Jun 2009 Link to this post

    Morning Martin

    I have raised a support ticket, 218108, to reproduce the problem.  The sample project will open to identical pages, one with a decorator and one without.

    Hopefully this should demonstrate the problem.
  7. Garrett
    Garrett avatar
    1 posts
    Member since:
    Jun 2009

    Posted 18 Jun 2009 Link to this post

    I'm having a similar issue with the RadWindow.  No matter how I style or organize my radWindow page I always get scrollbars in IE, but it works fine in Firefox.  I've somewhat fixed this with some js:

    function radWindow_OnClientLoad(oWnd, args) {  
        if ($telerik.isIE) {  
            window.setTimeout('fixSize()', 0);  
        }  
    }  
     
    function fixSize() {  
        var rwm = GetRadWindowManager();  
        var oWnd = rwm.GetActiveWindow();  
        oWnd.SetSize(oWnd.GetWidth() + 15, oWnd.GetHeight() + 15);  

    By adding the extra space to the window the scrollbars go away... Until I mouseover a radComboBox within the radWindowPage, which triggers the scrollbars to appear again.

    I've tried calling the autoSize() function if this is due to the page size changing after load but that doesn't seem to do anything.
  8. Paul Mc
    Paul Mc avatar
    32 posts
    Member since:
    Sep 2007

    Posted 19 Jun 2009 Link to this post

    Morning Garrett

    I dont suppose its going to help you on the basis that you look to be already doing something similar, but we raised a support ticket and were told to the following code:

    <script type="text/javascript">    
            function OnClientPageLoad(oWindow, args)    
            {    
                setTimeout(    
                    function()    
                    {    
                        oWindow.autoSize();    
                    }, 100);    
            }    
    </script>    
     

    I have to admit that I haven't tried it as yet on the basis that I have been off dong other things and we dont really like autosizing after a period of timeout because the user sees the resize on load, but it might help you in finding your solution a little quicker.

    Keep me posted how you get on this and hopefully i'll be able to get time to try it again soon.
  9. Eric Klein
    Eric Klein avatar
    183 posts
    Member since:
    Aug 2009

    Posted 25 Mar 2010 Link to this post

    Thanks for that code.  I was having the same issue
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017