Edit this page

Radio Button

The RadRadioButton control inherits from the RadioButton control and implements the ICommandSource interface. Because of the inheritance it has all of the features that the standard RadioButton control has. The ICommandSource implementation allows you to attach commands to the button, that will be executed when the RadRadioButton is clicked.

To learn more about the members of the RadRadioButton class you can read here.

You can see how to use an ICommand with a button in the Commands topic.

Instantiating RadButton

You can instantiate your RadRadioButton in both XAML and code. Here is an example:

The RadRadioButton control is located in the Telerik.Windows.Controls.dll and in order to use it in your project you have to add a reference to the assembly. You can find more info here.
Then in XAML you have to declare the namespace: xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"

[XAML] Example 1: Defining a button in XAML

<telerik:RadRadioButton Content="Radio Item" />

[C#] Example 2: Defining a button in code

RadRadioButton radRadioButton = new RadRadioButton() { Content = "Radio Item" };

[VB.NET] Example 2: Defining a button in code

Dim radRadioButton As New RadRadioButton() With { _
    .Content = "Radio Item" _

Handling the Button Checked Event

To execute some logic when the RadRadioButton gets checked, you have to handle the Checked event.

As any other button the RadRadioButton exposes a Click event as well.

Here is an example of handling the Checked event of a button.

[XAML] Example 3: Subscribing to the Checked event

<telerik:RadRadioButton Content="Radio Item" Checked="RadRadioButton_Checked"/>

[C#] Example 4: Defining a Checked event handler

private void RadRadioButton_Checked(object sender, RoutedEventArgs e)
    //implement your logic here

[VB.NET] Example 4: Defining a Checked event handler

Private Sub RadRadioButton_Checked(sender As Object, e As RoutedEventArgs)
    'implement your logic here '
End Sub

The RadRadioButton also exposes Unchecked event that is called when the button is unchecked. The same handling (as with the Checked event) applies for the Unchecked event.

Grouping RadRadioButtons

By grouping the RadRadioButtons the user will be allowed to check only one button in the group. In order to group several RadRadioButtons you just have to place them in the same layout panel. Here is an example:

[XAML] Example 5: Grouping radio buttons

    <telerik:RadRadioButton Content="Item 1.1" />
    <telerik:RadRadioButton Content="Item 1.2" />
    <telerik:RadRadioButton Content="Item 2.1" />
    <telerik:RadRadioButton Content="Item 2.2" />

The above code creates two groups of RadRadioButtons.

Customizing the RadRadioButton

  • IsBackgroundVisible - this property is of type bool and it controls the visibility of the background and the border of the RadRadioButton control in normal state

See Also