This is a migrated thread and some comments may be shown as answers.

Window AutoSize and Form Decorator

7 Answers 170 Views
Window
This is a migrated thread and some comments may be shown as answers.
Paul Mc
Top achievements
Rank 1
Paul Mc asked on 05 Jun 2009, 01:14 PM
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.

7 Answers, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 05 Jun 2009, 01:50 PM
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.
0
Paul Mc
Top achievements
Rank 1
answered on 05 Jun 2009, 02:06 PM
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.
0
Martin
Telerik team
answered on 08 Jun 2009, 09:44 AM
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.
0
Paul Mc
Top achievements
Rank 1
answered on 08 Jun 2009, 10:09 AM
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.
0
Garrett
Top achievements
Rank 1
answered on 18 Jun 2009, 11:41 PM
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.
0
Paul Mc
Top achievements
Rank 1
answered on 19 Jun 2009, 08:20 AM
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.
0
Eric Klein
Top achievements
Rank 1
answered on 25 Mar 2010, 04:00 PM
Thanks for that code.  I was having the same issue
Tags
Window
Asked by
Paul Mc
Top achievements
Rank 1
Answers by
Martin
Telerik team
Paul Mc
Top achievements
Rank 1
Garrett
Top achievements
Rank 1
Eric Klein
Top achievements
Rank 1
Share this question
or