Selection via CheckBox
The RadGridView's API offers you a GridViewSelectColumn, with the help of which you can perform a selection via CheckBox. The purpose of this tutorial is to show you how to achieve this behavior.
Here is a RadGridView declaration, which is populated with some sample data.
<telerik:RadGridView x:Name="radGridView"
IsReadOnly="False"
AutoGenerateColumns="False">
<telerik:RadGridView.Columns>
<telerik:GridViewSelectColumn />
<telerik:GridViewDataColumn DataMemberBinding="{Binding Id}"
Header="ID"/>
<telerik:GridViewDataColumn DataMemberBinding="{Binding OrderNO, Mode=TwoWay}"
Header="Order No">
</telerik:GridViewDataColumn>
<telerik:GridViewDataColumn DataMemberBinding="{Binding OrderDate, Mode=TwoWay}"
Header="Order Date">
</telerik:GridViewDataColumn>
<telerik:GridViewDataColumn DataMemberBinding="{Binding Country, Mode=TwoWay}"
Header="Country">
</telerik:GridViewDataColumn>
<telerik:GridViewDataColumn DataMemberBinding="{Binding Shipped, Mode=TwoWay}"
Header="Shipped?">
</telerik:GridViewDataColumn>
</telerik:RadGridView.Columns>
</telerik:RadGridView>
In order to enable the selection via checkbox behavior, you need to perform the following instructions:
- Enable multiple selection for the RadGridView.
<telerik:RadGridView SelectionMode="Extended">
<telerik:RadGridView.Columns>
<telerik:GridViewSelectColumn/>
<!--...-->
</telerik:RadGridView.Columns>
</telerik:RadGridView>
When you want to use selection via checkbox, then:1. Set the SelectionMode property to Extended or Multiple. Leaving it to Single you won't be able to select all of the entries in the RadGridView.2. Add a GridViewSelectColumn.
If you need further information for the GridViewSelectColumn and all other provided columns take a look at the this topic.