如果我从一页RadGridView转到下一页(通过DataPager),我将失去上一页的行选择。
这就是为什么如果我回来,以前选择的项目将不再被选中。
如何在RadDataGrid中保留选定的行?
代码:
<telerik:RadGridView Margin="5" Grid.Row="2"
SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
Name="DataGrid"
AutoGenerateColumns="False"
ShowGroupPanel="False"
CanUserDeleteRows="False"
CanUserInsertRows="False"
CanUserFreezeColumns="False"
telerik:StyleManager.Theme="Windows8"
SelectionMode="Extended"
ValidatesOnDataErrors="None"
IsReadOnly="True"
ItemsSource="{Binding View}"
IsBusy="{Binding View.IsBusy}"
RowIndicatorVisibility="Collapsed"
IsSynchronizedWithCurrentItem="False"
FilterOperatorsLoading="DataGrid_FilterOperatorsLoading">
<i:Interaction.Behaviors>
<behaviors:MultiSelectBehavior SelectedItems="{Binding SelectedItems}" />
</i:Interaction.Behaviors>
<telerik:RadGridView.Columns>
<telerik:GridViewSelectColumn/>
<telerik:GridViewDataColumn Header="Производитель" DataMemberBinding="{Binding MakerName}" ShowDistinctFilters="False"/>
<telerik:GridViewDataColumn Header="Номер" DataMemberBinding="{Binding Number}" ShowDistinctFilters="False"/>
<telerik:GridViewDataColumn Header="Наименование" DataMemberBinding="{Binding Name}" ShowDistinctFilters="False"/>
<telerik:GridViewDataColumn Header="Товарная группа" DataMemberBinding="{Binding GroupName}" ShowDistinctFilters="False"/>
<telerik:GridViewDataColumn Header="Вес" DataMemberBinding="{Binding WeightPhysical}" ShowDistinctFilters="False"/>
</telerik:RadGridView.Columns>
</telerik:RadGridView>
<telerik:RadDataPager Height="28" Grid.Row="3"
NumericButtonCount="20"
Margin="5"
Name="DataPager"
Source="{Binding View}"
telerik:StyleManager.Theme="Windows8"
DisplayMode="All"
Style="{StaticResource RadDataPagerStyle}"
AutoEllipsisMode="None"/>