Dear Support!
I am using RadControls_for_WPF_2011_3_1205_DEV_hotfix.
When I am using RadGridView with VirtualQueryableCollectionView and I am pressing PageDown it's sometimes not working.
Every third keypress is not working (refer attachment).
Please let me know how to resolve the issue.
MainWindow.xaml
MainWindow.xaml.cs
MainViewModel.cs
Model.cs
I am using RadControls_for_WPF_2011_3_1205_DEV_hotfix.
When I am using RadGridView with VirtualQueryableCollectionView and I am pressing PageDown it's sometimes not working.
Every third keypress is not working (refer attachment).
Please let me know how to resolve the issue.
MainWindow.xaml
<
Window
x:Class
=
"VirtualQueryableCollectionViewBugDemo.MainWindow"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
Title
=
"MainWindow"
Height
=
"510"
Width
=
"700"
>
<
DockPanel
>
<
TextBlock
Width
=
"250"
Text
=
"{Binding Log}"
/>
<
telerik:RadGridView
ItemsSource
=
"{Binding VirtualQueryableCollectionView}"
EnableRowVirtualization
=
"True"
/>
</
DockPanel
>
</
Window
>
MainWindow.xaml.cs
namespace
VirtualQueryableCollectionViewBugDemo
{
public
partial
class
MainWindow : Window
{
public
MainWindow()
{
InitializeComponent();
this
.DataContext =
new
MainViewModel();
}
}
}
MainViewModel.cs
using
System;
using
System.Collections.ObjectModel;
using
System.ComponentModel;
using
System.Linq;
using
Telerik.Windows.Data;
namespace
VirtualQueryableCollectionViewBugDemo
{
public
class
MainViewModel : INotifyPropertyChanged
{
public
VirtualQueryableCollectionView VirtualQueryableCollectionView {
get
;
set
; }
private
ObservableCollection<Row> items {
get
;
set
; }
public
MainViewModel()
{
this
.items =
new
ObservableCollection<Row>(Generator.GenerateTestData());
this
.VirtualQueryableCollectionView =
new
VirtualQueryableCollectionView(
this
.items);
this
.VirtualQueryableCollectionView.LoadSize = 20;
this
.VirtualQueryableCollectionView.ItemsLoading += (s, e) =>
{
AppendLog(
string
.Format(
"Load StartIndex={0} ItemsCount={1}"
, e.StartIndex, e.ItemCount));
this
.VirtualQueryableCollectionView.Load(e.StartIndex,
this
.items.Cast<Row>().Skip(e.StartIndex).Take(e.ItemCount));
};
}
private
string
log;
public
string
Log
{
get
{
return
this
.log; }
set
{
this
.log = value;
RaisePropertyChanged(
"Log"
);
}
}
public
void
AppendLog(
string
message)
{
this
.Log = message + Environment.NewLine +
this
.Log;
}
public
event
PropertyChangedEventHandler PropertyChanged;
private
void
RaisePropertyChanged(
string
propertyName)
{
if
(
this
.PropertyChanged !=
null
)
{
this
.PropertyChanged(
this
,
new
PropertyChangedEventArgs(propertyName));
}
}
}
}
Model.cs
using
System;
using
System.Collections.Generic;
namespace
VirtualQueryableCollectionViewBugDemo
{
public
class
Row
{
public
int
Id {
get
;
set
; }
public
DateTime DateTime {
get
;
set
; }
public
TimeSpan TimeSpan {
get
;
set
; }
}
public
static
class
Generator
{
public
static
int
TestDataLength = 1 * 1000 * 1000;
public
static
Random rng =
new
Random();
public
static
List<Row> GenerateTestData()
{
var result =
new
List<Row>(TestDataLength);
for
(
int
i = 0; i < TestDataLength; i++)
{
string
name = i.ToString();
DateTime dateTime =
new
DateTime(rng.Next(1990, 2020), rng.Next(1, 12), rng.Next(1, 28));
TimeSpan timeSpan =
new
TimeSpan(rng.Next(1, 23), rng.Next(1, 59), rng.Next(1, 59));
result.Add(
new
Row()
{
Id = i,
DateTime = dateTime,
TimeSpan = timeSpan
});
}
return
result;
}
}
}