Edit this page

Select Column

The GridViewSelectColumn derives from GridViewColumn and its content is represented by a CheckBox for each row. It differs from the GridViewCheckBoxColumn as it does not bind to data. Instead, it allows you to select a given row via a checkbox, in other words - each CheckBox's IsChecked property is bound to the IsSelected property of the corresponding row.

Example 1: Defining GridViewSelectColumn in XAML

<telerik:RadGridView AutoGenerateColumns="False">
        <telerik:GridViewSelectColumn />
        <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" />

Figure 1: The GridViewSelectColumn

The GridViewSelectColumn

If you set RadGridView's SelectionMode property to either Extended or Multiple, you will be able to select more than one row by clicking on the desired checkbox or to select all the rows by clicking on the checkbox in the header.

Example 2: Define GridViewDataColumn with Extended SelectionMode

<telerik:RadGridView AutoGenerateColumns="False"
        <telerik:GridViewSelectColumn />
        <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" />

Figure 2: The GridViewSelectColumn with Extended SelectionMode

The GridViewSelectColumn with Extended SelectionMode

CheckBoxStyle and HeaderCheckBoxStyle

GridViewSelectColumn exposes two properties of type style: CheckBoxStyle and HeaderCheckBoxStyle. You can use them to style the respective checkboxes.

Example 3: Creating appropriate styles

<Style x:Key="CheckBoxStyle" TargetType="CheckBox">
    <Setter Property="Background" Value="Red" />
<Style x:Key="HeaderCheckBoxStyle" TargetType="CheckBox">
    <Setter Property="Background" Value="Blue" />

Example 4: Setting RadGridView's CheckBoxStyle and HeaderCheckBoxStyle

<telerik:GridViewSelectColumn CheckBoxStyle="{StaticResource CheckBoxStyle}" 
                              HeaderCheckBoxStyle="{StaticResource HeaderCheckBoxStyle}"/>

Figure 3 shows the final result:

Figure 3: The styled GridViewSelectColumn

The styled GridViewSelectColumn

See Also

Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article