Edit this page

Getting Started

This tutorial will walk you through the creation of a RadWindow and will show you how to:

Declare a RadWindow

In order to use RadWindow control in your projects you have to add references to the following assemblies:

  • Telerik.Windows.Controls
  • Telerik.Windows.Controls.Navigation
  • Telerik.Windows.Data

You can find more info here.

Here is an example of declaring a RadWindow.

It's not a good practice do declare your RadWindow as visual element in XAML. The only scenario, when it is meaningful to use the RadWindow in XAML, is when it represents the entire user control. To learn more about that read here.

RadWindow radWindow = new RadWindow();
radWindow.Width = 400;
radWindow.Height = 300;
Dim radWindow As New RadWindow()
radWindow.Width = 400
radWindow.Height = 300

Show the RadWindow

To open the RadWindow you have to call its Show() method. Here is an example.

In order to make the window modal you have to call the ShowDialog() method. To learn more about modal windows read here.

radWindow.Show();
radWindow.Show()

Add content to the RadWindow

To add content to the RadWindow you have to use the Content property or the ContentTemplate property. Here is an example of setting the Content property.

As the Content property is of type object you can set it to any control that you like. If you want to have a more complex content that consists of more than one control, be sure to wrap them inside a layout control and pass the layout control as content.You can also set the content of the RadWindow to a UserControl.

You can skip the in-line setting of the Content property and define the content directly under the RadWindow tag.

The only scenario, where you can add content to the RadWindow at design-time, is when the RadWindow represents an entire user control. To learn more about that read here.

Grid grid = new Grid();
grid.Background = new SolidColorBrush(Color.FromArgb(255, 240, 255, 255));
radWindow.Content = grid;
Dim grid As New Grid()
grid.Background = New SolidColorBrush(Color.FromArgb(255, 240, 255, 255))
radWindow.Content = grid

Use predefined windows

There is a set of predefined dialog windows that can be directly used. Such windows are the Confirm, Alert and Prompt dialogs. These dialogs can be shown by calling the respective methods of the static RadWindow class.

All of the predefined windows are modal windows.

  • Alert() - shows an alert dialog. This method has 3 overloads. To learn more read here.

RadWindow.Alert("Hello!");
RadWindow.Alert("Hello!")

  • Confirm() - shows a confirm dialog. This method has 2 overloads. To learn more read here.

RadWindow.Confirm(new DialogParameters()
{
    Content = "Are you sure?"
});
Dim parameters As New DialogParameters()
parameters.Content = "Are you sure?"
RadWindow.Confirm(parameters)

  • Prompt() - shows a prompt dialog. This method has 3 overloads. To learn more read here.

RadWindow.Prompt(new DialogParameters()
{
    Content = "Enter your name:"
});
Dim parameters As New DialogParameters()
parameters.Content = "Enter your name:"
RadWindow.Confirm(parameters)

See Also

Was this article helpful? Yes No

Give article feedback

Tell us how we can improve this article

Dummy