Hello everyone
I got a radgridView with an autogeneratingColumn to false
<
telerik:RadGridView
Margin
=
"8,10,8,32.96"
ShowGroupPanel
=
"False"
CanUserReorderColumns
=
"False"
CanUserDeleteRows
=
"False"
CanUserInsertRows
=
"False"
CanUserResizeRows
=
"False"
CanUserSortColumns
=
"False"
CanUserFreezeColumns
=
"False"
CanUserResizeColumns
=
"False"
RowIndicatorVisibility
=
"Visible"
ItemsSource
=
"{Binding Files}"
SelectedItem
=
"{Binding SelectedFile}"
AutoGeneratingColumn
=
"GridViewDataControlOnAutoGeneratingColumn"
IsFilteringAllowed
=
"True"
PreparingCellForEdit
=
"GridViewDataControl_OnPreparingCellForEdit"
/>
This radGidview show some line with some column Checkbox (not fix column count, depend on data), see attached file. My goal is when user double click header row, all row checkbox will be checked, and the best of the best would be I could put a row checkbox in the header row but I don't think it's possible.
I also tried to put some command line like a button column but I can't get the right selected row when button is first clicked.
See below for the autogenerating column event :
Private
Sub
GridViewDataControlOnAutoGeneratingColumn(sender
As
Object
, e
As
GridViewAutoGeneratingColumnEventArgs)
Dim
dataColumn = TryCast(e.Column, GridViewDataColumn)
If
(dataColumn
Is
Nothing
)
Then
Return
If
(e.Column.UniqueName =
"FileName"
)
Then
e.Column.Header =
"File Name"
e.Column.DisplayIndex = 0
e.Column.Width = 200
ElseIf
(e.Column.UniqueName =
"AssignedTag"
)
Then
Dim
column =
New
GridViewComboBoxColumn()
column.DataMemberBinding =
CType
(e.Column, GridViewDataColumn).DataMemberBinding
column.ItemsSource =
CType
(
Me
.DataContext, FileViewModel).AcceptedTags
column.Header =
"Assigned Tag"
column.DisplayIndex = 1
column.Width = 200
column.IsFilterable =
False
e.Column = column
Else
Dim
checkBoxColumn =
New
GridViewCheckBoxColumn()
checkBoxColumn.DataMemberBinding = dataColumn.DataMemberBinding
checkBoxColumn.Header = dataColumn.Header
checkBoxColumn.UniqueName = dataColumn.UniqueName
checkBoxColumn.EditTriggers = GridViewEditTriggers.CellClick
checkBoxColumn.AutoSelectOnEdit =
True
checkBoxColumn.Width = 50
checkBoxColumn.HeaderTextAlignment = TextAlignment.Center
checkBoxColumn.TextAlignment = TextAlignment.Center
Dim
sty
As
New
Style(
GetType
(GridViewCell))
sty.Setters.Add(
New
Setter
With
{.
Property
= GridViewCell.HorizontalContentAlignmentProperty, .Value = HorizontalAlignment.Center})
checkBoxColumn.CellStyle = sty
e.Column = checkBoxColumn
End
If
Dim
binding =
New
Binding(
"IsInEditMode"
)
binding.Converter =
Me
._invertedBooleanConverter
e.Column.SetBinding(Telerik.Windows.Controls.GridViewColumn.IsReadOnlyProperty, binding)
End
Sub
So how Can I got a double click on header row or insert a checkbox into header row ?
thansk
Regards