Using on RadWindow as the Container for another?

4 posts, 0 answers
  1. Xorcist
    Xorcist avatar
    92 posts
    Member since:
    Apr 2009

    Posted 19 Feb 2013 Link to this post

    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?

  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 20 Feb 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Xorcist
    Xorcist avatar
    92 posts
    Member since:
    Apr 2009

    Posted 20 Feb 2013 Link to this post

    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?
  5. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 20 Feb 2013 Link to this post

    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.
Back to Top