setSize does not work

2 posts, 0 answers
  1. Hee
    Hee avatar
    25 posts
    Member since:
    Sep 2011

    Posted 05 Jan 2012 Link to this post

    Hello

    I want to change modal window size dynamically.
    So I using setSize client method. But it does not work. Is there something wrong with my code?
    Here is my javascript code.
    function RadButtonNew_OnClientClicked() {
        var oManager = GetRadWindowManager();
        var windowClientID = "RadWindowTest";
        var oWnd = oManager.getWindowById(windowClientID);
     
        oWnd.setUrl("./Test.aspx");
        oWnd.set_title("New");
        oWnd.set_reloadOnShow(true);
     
        oWnd.show();
        var popupWidth = $telerik.$(window).width() * 0.8;
        var popupHeight = $telerik.$(window).height() * 0.8;
     
        oWnd.setSize(popupWidth, popupHeight);
        oWnd.center();
         
        return false;
    }

    aspx
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" AutoSize="false"
                Modal="false" VisibleTitlebar="true" Width="600" Height="400" MinWidth="600" MinHeight="400" Behaviors="Close, Move, Resize"
                VisibleStatusbar="false" Skin="Default" ShowContentDuringLoad="false" ReloadOnShow="false"
                Style="position: absolute; z-index: 7000;" RestrictionZoneID="RadPaneContents"
                OnClientBeforeClose="RadWindowManager1_OnClientBeforeClose" OnClientClose="RadWindowManager1_OnClientClose"
                OnClientShow="RadWindowManager1_OnClientShow" OnClientDragEnd="ResizeSplitterWrap">
                <Windows>
                    <telerik:RadWindow ID="RadWindowTest" runat="server" />
                </Windows>
            </telerik:RadWindowManager>


    I did set AutoSize="true" but it does not work too.
    In some case, even when I did set number not percentage, it does not work too.
    For example, setSize(1250, 700)
    set_width and SetWidth do not work too.
    I really don't know why it does not work.
    What is the problem?

    Hee
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 05 Jan 2012 Link to this post

    Hello,

    Try the following.
    JS:
    var width=oWnd.get_width()*0.8;
    var hght=oWnd.get_height()*0.8;
    oWnd.setSize(width,hght );

    Thanks,
    Princy.
Back to Top