I have ObservableCollections that are bound to RadGridView and RadtreeListView controls to fill out the contents. I am using the IsSelected binding to process various operations on the ObservableCollections depending on what rows are selected.
Here is how the binding for IsSelected is defined in my XAML:
And here is how the style is applied as an attribute in both the RadGridView and RadtreeListView tag definitions:
The problem:
If I have a view where some of the rows are not visible and I select all of the items (ctrl-A), only those items that are visible get the IsSelected property updated in the source objects. If I scroll the hidden rows into view, the IsSelected property for the bound objects in the ObservableCollection finally gets updated as each row is scrolled into view. So, apparently, "selecting all" selects all of the rows in the control, but the IsSelected property in the bound source objects in the ObservableCollection is updated only for visible rows.
The same happens if all rows are selected and I click on single row which deselects everything else: only the visible rows get the IsSelected property updated to false.
It works this way regardless of the state of the data virtualization. I'm scratching my head over this. Am I setting up the binding wrong or is this a bug?
Here is how the binding for IsSelected is defined in my XAML:
<
em:StatusRowStyleSelector
x:Key
=
"StatusRowStyleDefinition"
>
<
em:StatusRowStyleSelector.StatusRowStyle
>
<
Style
TargetType
=
"telerik:GridViewRow"
>
<
Setter
Property
=
"Background"
Value
=
"{StaticResource NormalBorderBrush}"
/>
<
Setter
Property
=
"IsSelected"
Value
=
"{Binding Path=IsSelected, Mode=TwoWay}"
/>
<
Setter
Property
=
"IsExpanded"
Value
=
"{Binding Path=IsExpanded, Mode=TwoWay}"
/>
</
Style
>
</
em:StatusRowStyleSelector.StatusRowStyle
>
</
em:StatusRowStyleSelector
>
And here is how the style is applied as an attribute in both the RadGridView and RadtreeListView tag definitions:
RowStyleSelector="{DynamicResource StatusRowStyleDefinition}"
SelectionMode="Extended"
SelectionUnit="FullRow"
The problem:
If I have a view where some of the rows are not visible and I select all of the items (ctrl-A), only those items that are visible get the IsSelected property updated in the source objects. If I scroll the hidden rows into view, the IsSelected property for the bound objects in the ObservableCollection finally gets updated as each row is scrolled into view. So, apparently, "selecting all" selects all of the rows in the control, but the IsSelected property in the bound source objects in the ObservableCollection is updated only for visible rows.
The same happens if all rows are selected and I click on single row which deselects everything else: only the visible rows get the IsSelected property updated to false.
It works this way regardless of the state of the data virtualization. I'm scratching my head over this. Am I setting up the binding wrong or is this a bug?