Can't set size of second radWindow when opening from within a radWindow

6 posts, 1 answers
  1. Jeff
    Jeff avatar
    7 posts
    Member since:
    Jul 2011

    Posted 04 Dec 2012 Link to this post

    setSize on the second radWindow is ignored. Here's my code. The second radWindow opens from the first but it's very small.

    Update: I just noticed I'm gett a javascript error but I don't know what it means.


    Parent Page:
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="Sitefinity" Behaviors="Close" Overlay="true" Modal="true"
        IconUrl="~/Sitefinity/WebsiteTemplates/App_Themes/1.0/Global/Img/Transparent.png" VisibleTitlebar="false" VisibleStatusbar="false">
        <Windows>
            <telerik:RadWindow ID="RadWindow1" Title="Sofia" runat="server" />
        </Windows>
    </telerik:RadWindowManager>
     
    <script type="text/javascript">
        //<![CDATA[
        function ShowVideoOverlay(img) {
            var mediaId = img.id;
            var channelId = '<%= ConfigurationManager.AppSettings["Videos"].ToString()%>';
            var oManager = radopen('<%= ResolveUrl("~/VideoOverlay.aspx?MediaId=' + mediaId + '")%>', null);
     
            oManager.setSize(1200, 750);
            oManager.center();
            oManager.SetActive();
     
            return false;
        }
        //]]>
    </script>

    VideoOverlay.aspx page:

    function ShowOverlay(parent, shareId) {
                    var oManager = GetRadWindow().get_windowManager();
                    setTimeout(function () {
                        oManager.open(GetBaseURL() + 'overlays/share-email.aspx?shareId=' + shareId, null);
     
                        oManager.setSize(600, 480);
                        oManager.center();
                        oManager.SetActive();
     
                        return false;
                    }, 0);
                }
  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3595 posts

    Posted 06 Dec 2012 Link to this post

    Hi Jeff,

    It seems you are trying to call methods of the RadWnidow to its manager, which is why you will get errors. The following article explains how to open a RadWindow from another RadWindow: http://www.telerik.com/help/aspnet-ajax/window-programming-opening-from-within-dialog.html.

    The way of opening RadWindows and how radopen()/open() return a reference that you can use with the RadWindow client-side API (to set its size, for example) is explained here: http://www.telerik.com/help/aspnet-ajax/window-programming-opening.html.


    All the best,
    Marin Bratanov
    the Telerik team
    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 their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jeff
    Jeff avatar
    7 posts
    Member since:
    Jul 2011

    Posted 06 Dec 2012 Link to this post

    I read these articles. That's how I got to where I'm currently at... cut and paste. I read the article again and if I change my funtion to get a reference to the window instead it still doesn't set the size.

    function ShowOverlay(parent, shareId) {
                    var oBrowserWnd = GetRadWindow().BrowserWindow;
                    setTimeout(function () {
                        oBrowserWnd.radopen(GetBaseURL() + 'overlays/share-email?parent=' + parent + '&shareId=' + shareId, null);
     
                        oBrowserWnd.setSize(600, 480);
                        oBrowserWnd.center();
                        oBrowserWnd.SetActive();
                    }, 0);
     
                    return false;
                }
  5. Answer
    Marin Bratanov
    Admin
    Marin Bratanov avatar
    3595 posts

    Posted 07 Dec 2012 Link to this post

    Hi Jeff,

    You can find attached an example that works. Note how I am using the correct references, as explained in the article I linked before. I hope examining it carefully will allow you to incorporate this functionality in your project.


    All the best,
    Marin Bratanov
    the Telerik team
    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 their blog feed now.
  6. Jeff
    Jeff avatar
    7 posts
    Member since:
    Jul 2011

    Posted 07 Dec 2012 Link to this post

    Thanks. I see the problem now.
  7. Veysel
    Veysel avatar
    6 posts
    Member since:
    May 2013

    Posted 01 Jul 2015 Link to this post

    hi there, I need similar solution about radwindow. example;I have 2 aspx page. first is opener.aspx, second is content.aspx.  but somethings change on controls (hide, change size, etc...) of content.aspx. these changes does inside of cadebehind (content.aspx.vb).opener.aspx opens content.aspx --> some desicions on content.aspx.vb --->  need to hide some controls on content.aspx page --> need resize to radwindow at first step opened.
     
    I dont interest OnClientResize="true". because height doesnt work correctly. width is ok.I hope you help me. thanks.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017