Resize RadWindow based on Page Content

2 posts, 0 answers
  1. Taiseer
    Taiseer avatar
    37 posts
    Member since:
    Oct 2007

    Posted 18 Dec 2011 Link to this post

    Dear all,

    I’m trying to open the Rad window as modal and to be able to calculate the size of the opened window based on the opened page size i.e 400x400 and keep it centered. I don’t not want to use the autosize property.

    Below is my Rad window setting as well the JS code which I use to recalculate the window size to fill the window.

    Yourhelp is appreciated to open the modal window centered and in correct size based on the content page.
    var oWnd = window.radopen(_EncryptedURL, "AdvancedForm");
    oWnd.set_title(pageTitle);
    resizeRadWindow(oWnd);
     
    function resizeRadWindow(radWindow) {
     
        var windowHeight = $(window).height();
        var windowWidth = $(window).width();
     
        windowHeight = (windowHeight * 97.5) / 100;
        windowWidth = (windowWidth * 98) / 100;
     
        radWindow.moveTo(10, 10);
        radWindow.setSize(windowWidth, windowHeight);
    }
    <
    rad:RadWindowManager ID="RadWindowManager1" runat="server">
            <Windows>
                <rad:RadWindow ID="AdvancedForm" runat="server" Modal="True" OpenerElementID="showDialog"
                    InitialBehaviors="None" ShowContentDuringLoad="false" Behaviors="Close" OnClientClose="refreshScheduler"
                    ReloadOnShow="True" Title="" NavigateUrl="" VisibleStatusbar="False">
                </rad:RadWindow>
            </Windows>
        </rad:RadWindowManager>
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 19 Dec 2011 Link to this post

    Hello,

    Take a look into the following KB article.
    Automatically resizing a RadWindow depending on its content

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top