Hi guys,
I get the following issue on the version 2014.2.0617.45:
When I select one row on top of the grid, then scroll down, and try to select other row - all the pages in between are getting loaded. The issue haven't reproduced on earlier version (2013.2.724.40).
Here is the code to reproduce the problem:
View:
ViewModel:
If you put a breakpoint in OnItemsLoading method - you'll see that grid requests all pages between two selected rows. Please, note, that it happens after regular single row selection, so no data pages in the middle of two selected rows are not needed.
I get the following issue on the version 2014.2.0617.45:
When I select one row on top of the grid, then scroll down, and try to select other row - all the pages in between are getting loaded. The issue haven't reproduced on earlier version (2013.2.724.40).
Here is the code to reproduce the problem:
View:
<Window x:Class="RadGridView_Virtualization.MainWindow" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" xmlns:local="clr-namespace:RadGridView_Virtualization" Title="MainWindow" Height="350" Width="525"> <Window.Resources> <local:MyViewModel x:Key="MyViewModel" /> </Window.Resources> <Grid DataContext="{StaticResource MyViewModel}"> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto"></ColumnDefinition> <ColumnDefinition></ColumnDefinition> </Grid.ColumnDefinitions> <telerik:RadGridView x:Name="gridAccessList" Height="240" Width="370" IsFilteringAllowed="False" CanUserReorderColumns="True" AutoGenerateColumns="False" ItemsSource="{Binding Path=Items}" EnableRowVirtualization="True" SelectionMode="Extended" ScrollViewer.IsDeferredScrollingEnabled="True" IsReadOnly="True" ShowGroupPanel="False"> <telerik:RadGridView.Columns> <telerik:GridViewDataColumn DataMemberBinding="{Binding Id}" Width="*"/> </telerik:RadGridView.Columns> </telerik:RadGridView> </Grid></Window>ViewModel:
using System.Collections.Generic;using System.ComponentModel;using Telerik.Windows.Data;namespace RadGridView_Virtualization{ public class MyViewModel : INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; public MyViewModel() { Items = new VirtualQueryableCollectionView<DummyData> { VirtualItemCount = LoadSize, LoadSize = this.LoadSize }; Items.ItemsLoading += OnItemsLoading; } private void OnItemsLoading(object sender, VirtualQueryableCollectionViewItemsLoadingEventArgs args) { Items.VirtualItemCount = 35000; Source = new List<DummyData>(); for (int i = 0; i < args.ItemCount; i++) { Source.Add(new DummyData { Id = args.StartIndex + i }); } Items.Load(args.StartIndex, Source); } private List<DummyData> source; public List<DummyData> Source { get { return this.source; } set { this.source = value; } } private int loadSize = 100; public int LoadSize { get { return loadSize; } set { loadSize = value; } } public VirtualQueryableCollectionView<DummyData> Items { get; private set; } public class DummyData { public int Id { get; set; } } }}If you put a breakpoint in OnItemsLoading method - you'll see that grid requests all pages between two selected rows. Please, note, that it happens after regular single row selection, so no data pages in the middle of two selected rows are not needed.