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

Programmatic RadWindow

6 Answers 394 Views
Window
This is a migrated thread and some comments may be shown as answers.
Kyle Schiele
Top achievements
Rank 1
Kyle Schiele asked on 26 Oct 2007, 04:09 PM

Can someone advise how to programmatically create a radwindow and it needed elements?

And then add it to the page.

Kyle

6 Answers, 1 is accepted

Sort by
0
Obi-Wan Kenobi
Top achievements
Rank 1
answered on 26 Oct 2007, 05:33 PM
The following example illustrates how to create new windows on the client:
http://www.telerik.com/DEMOS/ASPNET/Prometheus/Window/Examples/WindowObject/DefaultCS.aspx

I suppose , that if you want to create it on the server, you should create an object from RadWindow type and add it to RadWindowManager.Windows collection:
RadWindow myWin = new RadWindow();
myWin.properties=...
.....
RadWindowManager1.Windows.Add(myWin);
0
Georgi Tunev
Telerik team
answered on 29 Oct 2007, 08:31 AM
Hello Kyle,

If you are creating a single RadWindow Prometheus only, you don't need to add it to the RadWindowManager Windows collection. You should add it to the form's Controls collection instead.
e.g.

Telerik.Web.UI.RadWindow newwindow = new Telerik.Web.UI.RadWindow();
newwindow.NavigateUrl =
"http://www.google.com";
newwindow.ID =
"RadWindow1";
newwindow.VisibleOnPageLoad =
true;
//set other properties
form1.Controls.Add(newwindow);




Sincerely yours,
Georgi Tunev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Chris
Top achievements
Rank 1
answered on 29 Jul 2008, 09:03 PM
Is is possible to programmatically add controls to the RadWindow once you create it.  I want to display system messages to the user, such as exception messages.

I currently have a BasePage object that all my site pages inherit, this allows me to provide common functionality to all forms.  This base has a "ShowMessage" method that takes an exception object and formats it and displays it to the user in a label control that is programmatically added to the form in the base class.

I want to replace this label with a RadWindow.  I have been able to get a window to open with correct title, icon, etc., but I am unable to add content to the body of the window.

I must be overlooking something, is there a way to programmatically add controls to the RadWindow to be renderd at runtime.

Thanks,
Chris
0
Svetlina Anati
Telerik team
answered on 31 Jul 2008, 10:57 AM
Hi Chris,

You cannot add controls in the RadWindow control - it is designed to replace the standard browser window and that is why, just as it, it only loads an external page. You can create an additional WebForm, display the needed information in it and then show it in the RadWindow.

I am not quite sure about your exact scenario and requirements, but I also recommend to examine the RadToolTip control, which is very useful in such scenarios. You can find its online demos here.

Greetings,
Svetlina
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Anthony
Top achievements
Rank 1
answered on 10 May 2010, 04:23 PM
Hi,

I understand that the RadWindow control can now have custom content: http://demos.telerik.com/aspnet-ajax/window/examples/internalcontent/defaultcs.aspx

Can you please let me know which build included this update? I am sure the latest will contain it. but i would like to confirm if my current version excludes it.

I am using 2009.2.701.20...

Thanks



0
Georgi Tunev
Telerik team
answered on 11 May 2010, 12:05 PM
Hi Anthony,

This functionality was added in Q3 2009.

Regards,
Georgi Tunev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Window
Asked by
Kyle Schiele
Top achievements
Rank 1
Answers by
Obi-Wan Kenobi
Top achievements
Rank 1
Georgi Tunev
Telerik team
Chris
Top achievements
Rank 1
Svetlina Anati
Telerik team
Anthony
Top achievements
Rank 1
Share this question
or