RadControls for ASP.NET AJAX It is possible to increase the flexibility of the RadWindowManager and RadWindow by configuring them dynamically in the code-behind, based on external conditions on the page.The code below shows:
Looping through the Windows collection of a RadWindowManager
Setting properties to RadWindowManager and RadWindow objects
Creating a new RadWindow dynamically and adding it to the RadWindowManagerWindows collection or as a separate control in the form (for ASP.NET AJAX feature only)
Retrieving a window from the RadWindowManagerWindows collection and configuring it.
CopyC#
private void Page_Load(object sender, System.EventArgs e)
{
WindowManager.Skin = "Monochrome";
WindowManager.Height = Unit.Pixel(250);
int offsetLeft = 0;
foreach (Telerik.Web.UI.RadWindow win in WindowManager.Windows)
{
win.VisibleOnPageLoad = true;
win.Behaviors = Telerik.Web.UI.WindowBehaviors.Maximize | Telerik.Web.UI.WindowBehaviors.Close;
win.OffsetElementID = "OffsetElement";
win.Top = 15;
win.Left = offsetLeft;
offsetLeft += 100;
}
Telerik.Web.UI.RadWindow newWindow = new Telerik.Web.UI.RadWindow();
newWindow.NavigateUrl = "http://www.sitefinity.com";
newWindow.OpenerElementID = OpenerButton.ClientID;
newWindow.OffsetElementID = OpenerButton.ClientID;
newWindow.Top = Unit.Pixel(22);
newWindow.Left = Unit.Pixel(0);
form1.Controls.Add(newWindow);
Telerik.Web.UI.RadWindow firstWindow = WindowManager.Windows[0];
firstWindow.NavigateUrl = "http://www.telerik.com/products/sharepoint/overview.aspx";
}
CopyVB.NET
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
WindowManager.Skin = "Monochrome"
WindowManager.Height = Unit.Pixel(250)
Dim offsetLeft As Integer = 0
For Each win As Telerik.Web.UI.RadWindow In WindowManager.Windows
win.VisibleOnPageLoad = True
win.Behaviors = Telerik.Web.UI.WindowBehaviors.Maximize Or Telerik.Web.UI.WindowBehaviors.Close
win.OffsetElementID = "OffsetElement"
win.Top = 15
win.Left = offsetLeft
offsetLeft += 100
Next
Dim newWindow As New Telerik.Web.UI.RadWindow()
newWindow.NavigateUrl = "http://www.sitefinity.com"
newWindow.OpenerElementID = OpenerButton.ClientID
newWindow.OffsetElementID = OpenerButton.ClientID
newWindow.Top = Unit.Pixel(22)
newWindow.Left = Unit.Pixel(0)
form1.Controls.Add(newWindow)
Dim firstWindow As Telerik.Web.UI.RadWindow = WindowManager.Windows(0)
firstWindow.NavigateUrl = "http://www.telerik.com/products/sharepoint/overview.aspx"
End Sub