Display multiple RadWindow from button click

2 posts, 0 answers
  1. Jiten
    Jiten avatar
    67 posts
    Member since:
    Dec 2010

    Posted 02 Apr 2012 Link to this post

    Hello,

    I have data which should pass to print pdf. I want to display multiple Rad window but i will pass the values through for loop in another page and open that rad Window in another page.

    Could we open the rad window with different  data.

    I used the following code:
    Session["RTF"] = strPatientSummary;
                if (Session["RTF1"] != "" && intCount==0)
                        {
                            RadWindow2.NavigateUrl = "~/Editor/PrintNote.aspx?Count" + intCount;
                            RadWindow2.Height = 600;
                            RadWindow2.Width = 950;
                            RadWindow2.Top = 40;
                            RadWindow2.Left = 100;
                            RadWindow2.Behavior = WindowBehaviors.Maximize | WindowBehaviors.Minimize | WindowBehaviors.Close | WindowBehaviors.Move | WindowBehaviors.Pin;
                            RadWindow2.Modal = true;
                            RadWindow2.VisibleOnPageLoad = true; // Set this property to True for showing window from code    
                            RadWindow2.VisibleStatusbar = false;
                            RadWindow2.Title = "Print Note";
                          }
                        else if (Session["RTF2"] != "" && intCount == 1)
                        {
                            RadWindow3.NavigateUrl = "~/Editor/PrintNote.aspx";
                            RadWindow3.Height = 600;
                            RadWindow3.Width = 950;
                            RadWindow3.Top = 40;
                            RadWindow3.Left = 100;
                            RadWindow3.Behavior = WindowBehaviors.Maximize | WindowBehaviors.Minimize | WindowBehaviors.Close | WindowBehaviors.Move | WindowBehaviors.Pin;
                            RadWindow3.Modal = true;
                            RadWindow3.VisibleOnPageLoad = true; // Set this property to True for showing window from code    
                            RadWindow3.VisibleStatusbar = false;
                            RadWindow3.Title = "Print Note";
                         }
    and so no..

    and
    <telerik:RadWindowManager ID="RadWindowManager" runat="server" EnableViewState="false">
                                    <Windows>
                                           <telerik:RadWindow ID="RadWindow2" OpenerElementID="btnPrintNote_Click" runat="server"
                                            Behaviors="None">
                                        </telerik:RadWindow>
                                        <telerik:RadWindow ID="RadWindow3" OpenerElementID="btnPrintNote_Click" runat="server"
                                            Behaviors="None">
                                        </telerik:RadWindow>
                                                                                                     
                                    </Windows>
                                </telerik:RadWindowManager>

    but this is limited to the rad window. It will display how many rad window in the RadWindowManager.
  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    5811 posts

    Posted 04 Apr 2012 Link to this post

    Hi Jiteni,

    I am not sure I fully understand you, yet I advise that you start by examining this sticky thread: http://www.telerik.com/community/forums/aspnet-ajax/window/opening-radwindow-from-the-server.aspx. It explains the basic concept of opening a RadWindow from the server. You can combine it with the radopen() method of creating a new RadWindow as explained here: http://www.telerik.com/help/aspnet-ajax/window-programming-opening.html. Ultimately you can create a JS array in the code-behind that will hold the RadWindow settings (mostly URL, if the rest is common it can be set as settings to the RadWindowManager) and pass it as a parameter to a function already declared on the page. This function will be called from the code behind as explained in this article and it can loop  through the array's length and create new instances which you can configure via its client-side API: http://www.telerik.com/help/aspnet-ajax/window-programming-radwindow-methods.html.

    Alternatively, you can simply loop in the code-behind and create new RadWindow instances and add them to the page in a similar fashion that you currently do, but note that, like any dynamic control, they will not be persisted after a postback.


    Greetings,
    Marin
    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