This is a migrated thread and some comments may be shown as answers.

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

5 Answers 153 Views
Window
This is a migrated thread and some comments may be shown as answers.
Jeff
Top achievements
Rank 1
Jeff asked on 04 Dec 2012, 11:51 PM
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.
TypeError: this._popupElement is null


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);
            }

5 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 06 Dec 2012, 03:27 PM
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.
0
Jeff
Top achievements
Rank 1
answered on 06 Dec 2012, 06:45 PM
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;
            }
0
Accepted
Marin Bratanov
Telerik team
answered on 07 Dec 2012, 02:04 PM
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.
0
Jeff
Top achievements
Rank 1
answered on 07 Dec 2012, 05:34 PM
Thanks. I see the problem now.
0
Veysel
Top achievements
Rank 1
answered on 01 Jul 2015, 12:28 PM
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.
Tags
Window
Asked by
Jeff
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Jeff
Top achievements
Rank 1
Veysel
Top achievements
Rank 1
Share this question
or