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

Using on RadWindow as the Container for another?

3 Answers 55 Views
Window
This is a migrated thread and some comments may be shown as answers.
Xorcist
Top achievements
Rank 1
Xorcist asked on 19 Feb 2013, 02:04 PM
I seem to be having a little trouble with this. I would like to create a RadWindow with a Content Template that Contains another RadWindow, such that I get a parent child relation ship with outer RadWindow being the container for the inner one (i.e. if I move the outer window the inner window moves along with it, the inner window is completely confined to the space of the outer window, etc.). Is this possible? and if so does anyone have a working example?

3 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 20 Feb 2013, 11:04 AM
Hello,

This happens automatically if you load an entire page in the first RadWindow. This creates an iframe that hosts the child page and thus all controls are confined in it and move together with the parent window. The KeepInScreenBounds property of the child window can help keep it in the visible viewport of the iframe.

When you are using the ContentTemplate, however, you have two independent elements with absolute position and they cannot be linked like this. You could move the second one with code, attached to the OnClientDragEnd event of the first one, e.g.:
var second = $find("<%=RadWindow2.ClientID %>");
var firstBounds = sender.getWindowBounds();
second.moveTo(firstBounds.x + 20, firstBounds.y + 40);
setTimeout(function ()
{
second.setActive(true);
}, 0);

but all this will do is move the second "automatically", the end user will still be able to move, maximize, minimize and pin it. You can disable these behaviors (e.g. set the Behaviors property of the second one to None). You can test this out and if it fits your needs you can further build on top of it, but there will still be no actual relationship between the two.


Kind regards,
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
Xorcist
Top achievements
Rank 1
answered on 20 Feb 2013, 02:31 PM
In the first scenerio (using the iFrame) is there any way to get information from the page that has been loaded, and pass it back to the page hosting the RadWindow? Maybe by setting a hidden input or a javascript variable in the page being loaded, then reading that data in the OnClientPageLoad event of the RadWindow being used as the container?
0
Marin Bratanov
Telerik team
answered on 20 Feb 2013, 03:58 PM
Hi,

You can send information accross frames by following the approach from this article: http://www.telerik.com/help/aspnet-ajax/window-programming-calling-functions.html. If you need to go two levels up you can simply traverse the frame hierarchy without going through the RadWIndow object, i.e. window.top.calledFn(args) will try to execute the function from the topmost frame, usually the main page.


Greetings,
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.
Tags
Window
Asked by
Xorcist
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Xorcist
Top achievements
Rank 1
Share this question
or