Resize RadWindow to 80% of parent window

2 posts, 0 answers
  1. Tayonee
    Tayonee avatar
    52 posts
    Member since:
    Nov 2006

    Posted 26 May 2009 Link to this post

    I am having a difficulty understand how to the following: I have my site open in a normal IE 8 window, which can be resized (it is NOT maximized). I am opening a series of radWindow's inside of this browser tab. What I want to be able to do is have the radWindow open up with a 80% size of the original window, with it centered in the current browser tab content. Right now, it is not the correct size, and is sometimes opening off the visible page (scrolling being necessary) if I have tested my page using smaller resolution settings, like 1024x768 or 800x600. My native resolution is 1900x1200.

    Could you point me to some source code that would show me how to accomplish this? Right now i am using a RadWindowManager to open the windows, with setup code like this:



    telerik:RadWindowManager ID="RadWindowManager1" runat="server" Behavior="Default" InitialBehavior="None" Left="" Style="display: none;" Top="">  




    <telerik:RadWindow ID="RadWindow1" runat="server" Behavior="Default" Height="500px" InitialBehavior="None" Left="20" Modal="True" NavigateUrl="~/controls/HostPages/AdditionalServicesHost.aspx" OffsetElementID="<%# hypAdditionalServices.ClientID %>" OnClientClose="closewindow" OpenerElementID="<%# hypAdditionalServices.ClientID %>" Style="display: none;" Title="Services Sought" Top="20" Width="600px">  




    <telerik:RadWindow ID="RadWindow2" runat="server" Behavior="Default" Height="800px" InitialBehavior="None" Left="20" Modal="True" NavigateUrl="~/controls/HostPages/TypesOfCasesHost.aspx" OffsetElementID="<%# hypTypesOfCases.ClientID %>" OnClientClose="closewindow" OpenerElementID="<%# hypTypesOfCases.ClientID %>" Style="display: none;" Title="Type of Case/Issues" Top="20" Width="800px">  


    <telerik:RadWindow ID="radSurvey" runat="server" Behavior="Default" Height="625px" InitialBehavior="None" Left="20" Modal="True" NavigateUrl="FillOutSurvey.aspx" Style="display: none;" Title="Fill Out Survey" Top="20" Width="450px"> 






    <telerik:RadWindow ID="RadWindow10" runat="server" Behavior="Default" Height="625px" InitialBehavior="None" Left="20" Modal="True" NavigateUrl="practitionerdetails.aspx" Style="display: none;" Title="Practitioner Details" Top="20" Width="450px">














  2. Fiko
    Fiko avatar
    1406 posts

    Posted 29 May 2009 Link to this post

    Hi Tayonee,

    By design, the RadWindow control does not accept values in percent and you need to use fixed values in its declaration. In your case you can check the size of the browser window and set the appropriate values to the RadWindow by using its oWindow.setSize() function. Also, you can use the center() function of the RadWindow's client object in order to center the window according to the browser window's size. In your setup you open the RadWindow by using the OpenerElementID property, but this property can be used in simple scenarios only. In this case you need to use one of the approaches described in this help page. For example you can use the radopen() function as follows :

    function openWindow() 
        var oWindow = radopen("~/controls/HostPages/AdditionalServicesHost.aspx""RadWindow1");; 

    <asp:Button ID="Button1" runat="server" Text="Open RadWindow" OnClientClick="openWindow(); return false;" /> 

    Please note that in case that RadWindow's size is greater than the size of the browser window, it is expected that part of the RadWindow will not be visible. To ensure that the toolbar will always be visible on the page when the RadWindow is shown, you should use KeepInScreepBounds with value "true".

    I hope this helps.

    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.
Back to Top