I have RadWindow with lots of stuff and I want to use that window on more than one place in program so I put it in user control. Question is how, from code behind, to add that user control and RadWindows to show ? Suppose I have the button so when clicked it a window should appear.
3 Answers, 1 is accepted
0
Georgi Tunev
Telerik team
answered on 11 Oct 2010, 01:25 PM
Hi Sasa,
Basically, if the RadWindow is present in the user control, you could simply set his VisibleOnPageLoad property to true when you want to show it from server-side code. If you want to create a RadWindow from scratch and add it to a given page, then this help article will be of help. Note that when you are using Ajax to create / call the RadWindow it is better to add the dynamically created RadWindow not to the form but to a placeholder in that form (as you cannot ajaxify the <form> element).
Greetings,
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
I put PlaceHolder on page and inside UserControl
In UserControl I have RadWindow
In UserControl.PreRender event I put VisibleOnPageLoad = True
When I call UserControl from code behind with PlaceHolder1.Controls.Add(UserControl), UserControl.PreRender event is fired but window is not showing?! Why?
I am not quite sure that I understand your setup correctly as I don't know how exactly you set the RadWindow, but basically, if the RadWindow is present in the user control, it should be shown (see attached sample).
If in that user control you add the RadWindow programatically from codebehind, you should make sure that the RadWindow is actually added in the page - for example in a placeholder in that usercontrol.
Best wishes,
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