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

Display multiple RadWindow from button click

1 Answer 121 Views
Window
This is a migrated thread and some comments may be shown as answers.
Jiten
Top achievements
Rank 1
Jiten asked on 02 Apr 2012, 11:09 AM
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.

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 04 Apr 2012, 11:19 AM
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.
Tags
Window
Asked by
Jiten
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or