Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Window > Set Autosize= false for a Radwindow in javascript
RadControls for ASP.NET are no longer supported (see this page for reference). In case you have inquiries about the Telerik ASP.NET AJAX controls, post them in the pertinent ASP.NET AJAX forums.

Not answered Set Autosize= false for a Radwindow in javascript

Feed from this thread
  • manoj naik avatar

    Posted on Jun 2, 2011 (permalink)

    Hi Guys,

    I have set Autosize=true for a Radwindow (on server side) now for specific content I want to set a specific height in javascript to the radwindow. As I have set AutoSize=true it wont let me set a height. So first I need to set Autosize=false and then set the height. And i want to do it in javascript. I have tried the Autosize() method but it doesn't works. Can we set the autosize property of radwindow to false in javascript?
    Thanks in advance for help.

    <telerik:RadWindow ID="RadWindowPopup" AutoSize="true" Center="true" Width="645" Height="535" Modal="true" KeepInScreenBounds="true" VisibleTitlebar="false" VisibleStatusbar="false" Behaviors="none" ShowContentDuringLoad="true" ReloadOnShow="false" DestroyOnClose="false" OnClientShow="OnClientShow" OnClientClose="OnClientClose" runat="server" />

    Regards,
    Manoj

  • Marin Bratanov Marin Bratanov admin's avatar

    Posted on Jun 3, 2011 (permalink)

    Hello Manoj,

    The autosize functionality is called when the content inside the RadWindow is loaded. This means that at a later stage you should be able to set the size explicitly and it will persist until the page is reloaded.

    You can find my test page attached and here is a video from my experiment: http://screencast.com/t/3PYMTstXBRlh. On my end it seems to be working as expected. You can use my page as basis for your further development.

    If your scenario is much different than my demonstration project you can try making an AJAX request which updates only the desired RadWindow and in the code-behind set the AutoSize to false, since this property can only be changed on the server.

    Yet another possible approach is to use a container with explicit size and when your criteria are met call a JavaScript function that will resize the container accordingly and call the autosize() function so that the RadWindow will resize according to its new content:

    function resizeContainer()
    {
        document.getElementById("container").style.height = "700px";
        document.getElementById("container").style.width = "1000px";
        GetRadWindow().autoSize(true);
    }

    If that does not work for you as well please open a support ticket and send us a simple, runnable prooject that isolates your issue so we can investigate it further.



    Greetings,
    Marin
    the Telerik team

    Consider using RadControls for ASP.NET AJAX (built on top of the ASP.NET AJAX framework) as a replacement for the Telerik ASP.NET Classic controls, See the product support lifecycle here.

  • manoj naik avatar

    Posted on Jun 3, 2011 (permalink)

    Thanks Marin. :)
    Let me try this out. I ll get back to you soon!

  • manoj naik avatar

    Posted on Jun 3, 2011 (permalink)

    Hi Marin,

    Can I have Autosize set to true in server side and set the explicit height from the javascript later?

    Regards,
    Manoj

  • Posted on Jun 6, 2011 (permalink)

    Hello Manoj,

    I am not quite sure about your scenario. Here is the sample code that I tried which worked as expected at my end.

    aspx:
    <telerik:RadWindow ID="RadWindow1" Modal="false" Left="0" Top="0" EnableShadow="true"
              DestroyOnClose="true" Visible="true" Behaviors="Close,Move" VisibleOnPageLoad="false"
              runat="server" Title="PopupWindow" Skin="Web20">
    </telerik:RadWindow>
     <asp:Button ID="Button3" runat="server" Text="NewWindow" OnClick="Button3_Click" />
     <asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="openwindow(); return false;" />

    C#:
    protected void Button3_Click(object sender, EventArgs e)//opening window from server side
    {
         RadWindow1.AutoSize = true;//setting autosize from server side
          RadWindow1.VisibleOnPageLoad = true;
    }

    Javascript:
    function openwindow()
    {
        var wnd = $find('<%=RadWindow1.ClientID%>');
         wnd.set_height(500);//setting height from client side for the opened window
    }

    Thanks,
    Shinu.

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Window > Set Autosize= false for a Radwindow in javascript