This is a migrated thread and some comments may be shown as answers.

RadGridView + VirtualQueryableCollectionView PageDown bug

1 Answer 114 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Gyula
Top achievements
Rank 1
Gyula asked on 16 Dec 2011, 03:45 PM
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
<Window x:Class="VirtualQueryableCollectionViewBugDemo.MainWindow"
        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;
        }
    }
}

1 Answer, 1 is accepted

Sort by
0
Vera
Telerik team
answered on 16 Dec 2011, 04:05 PM
Hello Balázs,

May I ask you to try our Latest Internal Build (December 12)? We have made some improvements and I believe that you will not experience any issues with the navigation.

Greetings,
Vera
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Tags
GridView
Asked by
Gyula
Top achievements
Rank 1
Answers by
Vera
Telerik team
Share this question
or