I am using Telerik version 2014.1.331.45
I have a RadGridView like:
I need to select all cells of column on clicked column header
i wrote next code for make header clickable:
and custom button class:
but row.Cells[index] does not have property IsSelected, how I can set cell property selected?
I have a RadGridView like:
<
telerik:RadGridView
Name
=
"RadGridView"
ItemsSource
=
"{Binding DynamicValues, Mode=TwoWay}"
<br> SelectedItem="{Binding SelectedItem, Mode=OneWayToSource}" CanUserDeleteRows="True" <
br
> CanUserInsertRows="True" CanUserReorderColumns="False" CanUserSortColumns="False" <
br
> ShowGroupPanel="False"<
br
> IsFilteringAllowed="False"<
br
> SelectionMode="Extended"<
br
> SelectionUnit="Mixed"<
br
> IsSynchronizedWithCurrentItem="True" <
br
> behavoirs:ValidationBehavior.IsValidationEnabled="True" ClipboardPasteMode="SkipHiddenColumns">
I need to select all cells of column on clicked column header
i wrote next code for make header clickable:
foreach (var column in RadGridView.Columns)<
br
> {<
br
> var temp = column.Header;<
br
> column.Header = new MyButton { Content = temp.ToString(), ViewModel = this };<
br
> }
and custom button class:
private class MyButton :RadButton<
br
> {<
br
> public override string ToString()<
br
> {<
br
> return Content.ToString();<
br
> }<
br
><
br
> protected override void OnMouseDown(MouseButtonEventArgs e)<
br
> {<
br
> if (ViewModel.columnHeaders.ContainsKey(e.Source.ToString()))<
br
> {<
br
> foreach (var value in ViewModel.RadGridView.Items)<
br
> {<
br
> var row = ViewModel.RadGridView.ItemContainerGenerator.ContainerFromItem(value) as GridViewRow;<
br
> if (row != null) row.Cells[index].IsSelected ???<
br
> }<
br
> }<
br
> base.OnMouseDown(e);<
br
> }<
br
><
br
> public EditViewModelBase ViewModel { get; set; }<
br
> }
but row.Cells[index] does not have property IsSelected, how I can set cell property selected?