open child window in telerik radwindow

8.2k Views Asked by At

I want to open a child RadWindow with in a telerik:RadWindow with client side script, i have used "radopen", it showing a window but not exactly with same property and url as I configured. One more thing my Parent RadWindow is exists in a UserControl

this is my code:

<telerik:RadWindowManager ID="RadWindowManagerCustomValue" Style="overflow: hidden"
    ShowContentDuringLoad="false" VisibleStatusbar="false" ReloadOnShow="True" IconUrl=""
    DestroyOnClose="true" Modal="true" Height="390" Width="600" runat="server" OnClientClose="closeRadWindow"
    EnableShadow="true" Title="Add/Edit Agreement Type">
    <Windows>
        <telerik:RadWindow ID="AddCompanyDialog" ShowContentDuringLoad="false" runat="server"
            Title="Add Company" InitialBehaviors="Maximize" Behaviors="Close" NavigateUrl="somePage.aspx" />
    </Windows>
</telerik:RadWindowManager>



            function LoadCompanyPopup(sender, args) {

                radopen(null, "AddCompanyDialog");
            }
3

There are 3 best solutions below

2
On

My memory is a bit fuzzy since it's been a few months since I had messed with Telerik controls... but something tells me it was hard/not possible to open up a window within a window using javascript.

The code I have for this scenario opens up the window with the .NET code-behind using

radWindow.VisibleOnPageLoad = True

on a button's onClick event

EDIT:

I was mistaken! As rdmptn pointed out below. My sample javascript code for opening up a window inside a window:

    function closeWin() {
        GetRadWindow().close();
    }

    function GetRadWindow() {
        var oWindow = null; if (window.radWindow)
            oWindow = window.radWindow; else if (window.frameElement.radWindow)
            oWindow = window.frameElement.radWindow; return oWindow;
       }

    function ConfirmResult(sender, args) {
        var ajaxManager = $find("radAjaxManager");
        ajaxManager.ajaxRequest(args._argument);

        if (args._argument == "confirm")
            closeWin();
    }

    function OpenConfirmDialog() {
        var window = GetRadWindow().get_windowManager().getWindowByName("DeleteConfirmPopup");
        window.show();
        window.add_close(ConfirmResult);
        setTimeout(function () { window.set_modal(true); }, 0);
    }
0
On

Actually using JavaScript is the way to work with Telerik's RadWindow. It renders only on the client, so using it on the server is usually done by injecting scripts. Take a look at this thread on opening it from the server

At the original poster - take a look at these articles - opening a RadWindow from within a RadWindow on opening the second RadWindow properly (so it is not confined in the first) and at using multiple managers on the wrong URL you get - most likely you have more than one RadWindowManager on the page in which context you call radopen().

0
On

Use this simple Javascript code to open the window:

function LoadCompanyPopup()
{ var myWindow=window.radopen(null, "AddCompanyDialog"); }

Also, on your telerik:RadWindow tag, change your NavigateUrl attribute value from "somePage.aspx" to "./somePage.aspx" (to make sure the path to your aspx page is located).