Hello.
In the grid view, the selection unit is set to 'FullRow' and the selection mode is set to 'Extended'.
I want to know how to make a checkbox column and do multi-check.(Refer to the image)
Using GridViewSelectColumn will do something similar.
However, It is immediately reflected when selecting a row and does not support binding.
And I have to keep the checkbox variable when I close or open the window.
So I try to use GridViewCheckBoxColumn.
Anotherway is to put CellTemplate in GridViewDataColumn and do EventBindings, but the logic is not correct.
<
telerik:RadGridView
Margin
=
"10 0"
Width
=
"300"
ItemsSource
=
"{Binding Rooms}"
behaviour:GridViewMultiSelection.SelectedItems
=
"{Binding RoomItems}"
SelectionUnit
=
"FullRow"
SelectionMode
=
"Extended"
AutoGenerateColumns
=
"False"
ShowColumnHeaders
=
"True"
ShowGroupFooters
=
"False"
ShowGroupPanel
=
"False"
RowIndicatorVisibility
=
"Collapsed"
RowDetailsVisibilityMode
=
"Visible"
EnableColumnVirtualization
=
"True"
EnableRowVirtualization
=
"True"
VirtualizingPanel.IsVirtualizing
=
"True"
ScrollViewer.HorizontalScrollBarVisibility
=
"Auto"
ScrollViewer.VerticalScrollBarVisibility
=
"Auto"
FrozenColumnsSplitterVisibility
=
"Collapsed"
IsFilteringAllowed
=
"False"
AutoExpandGroups
=
"False"
>
<
telerik:RadGridView.Columns
>
<!--<telerik:GridViewSelectColumn/>-->
<
telerik:GridViewDataColumn
Header
=
"Name"
Width
=
"*"
IsReadOnly
=
"True"
DataMemberBinding
=
"{Binding Name}"
/>
<
telerik:GridViewDataColumn
Header
=
"ID"
Width
=
"0.7*"
IsReadOnly
=
"True"
DataMemberBinding
=
"{Binding Id}"
IsVisible
=
"False"
/>
<!--<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding IsChecked}"
Header
=
"Verification"
Width
=
"75"
>
<
telerik:GridViewDataColumn.CellTemplate
>
<
DataTemplate
>
<
CheckBox
IsChecked
=
"{Binding IsExcept}"
>
<
telerik:EventToCommandBehavior.EventBindings
>
<
telerik:EventBinding
EventName
=
"Checked"
Command
=
"{Binding RelativeSource={RelativeSource AncestorType=telerik:RadGridView}, Path=DataContext.OnCheckedCommand}"
/>
</
telerik:EventToCommandBehavior.EventBindings
>
</
CheckBox
>
</
DataTemplate
>
</
telerik:GridViewDataColumn.CellTemplate
>
</
telerik:GridViewDataColumn
>-->
<
telerik:GridViewCheckBoxColumn
Header
=
"Verification"
Width
=
"75"
DataMemberBinding
=
"{Binding IsChecked}"
IsReadOnly
=
"False"
EditTriggers
=
"CellClick"
AutoSelectOnEdit
=
"True"
IsThreeState
=
"False"
>
</
telerik:GridViewCheckBoxColumn
>
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
If the above problem is not solved, is there a way to keep the variable when closing or opening the window using GridViewSelectColumn?
Thanks.