Autosize doesn't decrease height when Lightweight

2 posts, 0 answers
  1. Andreas
    Andreas avatar
    143 posts
    Member since:
    May 2008

    Posted 02 Dec 2013 Link to this post


    We are calling the autoSize method manually to resize the window in some cases after load so that it fits with content.
    We had no problem with this when using Classic render mode, but when switching to Lighweight it doesn't decrease its width anymore!

    See the following sample:
    <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="window.aspx.vb" Inherits="TestaTredjepartWeb.window" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
    <head runat="server">
        <form id="form1" runat="server">
        <asp:ScriptManager ID="s" runat="server">
            <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
                    <telerik:RadWindow ID="RadWindow1" runat="server" VisibleOnPageLoad="true" AutoSize="true" RenderMode="Lightweight" Title="Hello" NavigateUrl="windowcontent.aspx" VisibleStatusbar="false" >

    Content window:
    <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="windowcontent.aspx.vb" Inherits="TestaTredjepartWeb.windowcontent" %>
    <!DOCTYPE html>
    <head runat="server">
        <title>This is the title</title>
            html, body, form
                padding: 0px;
                margin: 0px;
                overflow: hidden;
        <form id="form1" runat="server">
            <asp:ScriptManager ID="s" runat="server">
            <div id="div" style="background-color: red; height: 300px; width: 300px">
                <asp:Button ID="btn" runat="server" OnClientClick="$get('div').style.height = '200px';; return false;" />

    When clicking the button the height of the window should be 200px instead of 300px, but it only gets a little bit larger...
    If setting RenderMode="Classic" it does work as expected!

  2. Marin Bratanov
    Marin Bratanov avatar
    3914 posts

    Posted 02 Dec 2013 Link to this post

    Hello Andreas,

    I am afraid that this is a known problem with the AutoSize functionality - when Lightweight RenderMode is used and the content page has small heights (less than 250-300 pixels) the autosized dimensions are larger than the expected. I am afraid there are no actual workarounds for the case except:
    - using Classic RenderMode
    - OR using the ContentTemplate instead of an external page. This mode is a bit more stable and autosizing calculations work better.

    Please accept my apologies for the inconvenience caused.

    Marin Bratanov
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top