ASP.NET AJAX - Dynamically open Multiple RadWindows from Code behind

2 posts, 0 answers
  1. Naveen
    Naveen avatar
    4 posts
    Member since:
    Jan 2012

    Posted 12 Aug 2014 Link to this post


    I have a Radgrid from where i have to select multiple rows and on click on button in RadToolBar, i need to open a seperate Radwindow for each Row selected from code behind. All the Radwindows should be minimised except the last one.

    Please suggest.

    Thanks in advance!
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 13 Aug 2014 in reply to Naveen Link to this post

    Hi Naveen,

    Please try the below sample code snippet which works fine at my end.

    <telerik:RadGrid ID="rgrdOrders" runat="server" AllowPaging="true" DataSourceID="sqldsOrders" AllowMultiRowSelection="true">
        <ClientSettings Selecting-AllowRowSelect="true">
    <telerik:RadToolBar ID="rtoolbarOpenWin" runat="server" OnButtonClick="rtoolbarOpenWin_ButtonClick">
            <telerik:RadToolBarButton Text="Open Widow">

    protected void rtoolbarOpenWin_ButtonClick(object sender, Telerik.Web.UI.RadToolBarEventArgs e)
        int count;
        for (count = 1; count <= rgrdOrders.SelectedItems.Count; count++)
            RadWindow newWindow = new RadWindow();
            newWindow.ID = "RadWindow" + count;
            newWindow.VisibleOnPageLoad = true;
            if (count != rgrdOrders.SelectedItems.Count)
                string script = "function f(){minimizeWindow('"+newWindow.ClientID+"'); Sys.Application.remove_load(f);}Sys.Application.add_load(f);";
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", script, true);

    function minimizeWindow(rWindow) {
        var window = document.getElementById(rWindow);

Back to Top