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

How to do virtual scrolling in RadGrid??

8 Answers 129 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Shiva
Top achievements
Rank 1
Shiva asked on 14 Sep 2011, 06:54 PM
Dear Community,

We have around 5000 rows of data to be displayed on Silverlight RadGrid on a page and we want that to be displayed on a single page without any pagination. Since the amount of rows are quite large, we would like to use the concept of virtual scrolling in RadGrid so that limited number of rows is visible at a time and as the user scrolls down the grid, new rows keeps on appearing at the bottom.

I looked into the telerik demos and forums for this, but didn't find any working example to implement the same. I would like to request the community to please share a sample code with me that depicts the working and implementation of this concept.

In a nutshell, I'm looking for these things:
  1. Working code/example of implementing virtual scrolling. This includes both xaml and xaml.cs code.
  2. Link of any online resource available for this concept.
  3. Can we govern how many rows will be visible initially when the grid loads?
  4. Any disadvantage of virtual scrolling in terms of performance of the Silverlight page?
  5. Any alternate ways available to acheive what I'm looking for?

I would really appreciate your timely response on this. Please let me know if you need more details around this.

Regards,
Shiva

8 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 15 Sep 2011, 06:54 AM
Hello Shiva,

 You can check our virtual collection for more info:
http://demos.telerik.com/silverlight/#DataVirtualization/FirstLook

Greetings,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Shiva
Top achievements
Rank 1
answered on 15 Sep 2011, 07:00 AM
Dear Vlad,

I had a look at this post but I couldn't get anything out of it. If I go to the code of this demo, I see two files namely Example.xaml and Example.xaml.cs.

In Example.xaml.cs, there is no code except setting the data context of the user control and in Example.xaml,  there isn't any specific/different property of the RadGrid set which enabled virtual scrooling behaviour.

It would be great if you could please elaborate a bit for me.

Regards,
Shiva
0
Vlad
Telerik team
answered on 15 Sep 2011, 07:14 AM
Hello,

 You can check your local copy of our demos for actual code of our view models. 

Greetings,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Shiva
Top achievements
Rank 1
answered on 15 Sep 2011, 07:37 AM
Dear Vlad,

How can we use it without following MVVM pattern. I mean, I don't have a viewmodel class and have all of my code in the code behind only. With what value I must set the ItemsSource property of the grid?

I would be greatful if you could please share a small code snippet.

Cheers,
Shiva
0
Shiva
Top achievements
Rank 1
answered on 15 Sep 2011, 01:33 PM
Dear Vlad,

We have been able to implement data virtualization in RadGrid without MVVM pattern. Things are working fine except sorting and filtering.

I have thus posted an another thread in the forums around this problem and thus I would request you to please have a look at it and share your comments with us.

Here is the link to that post:

http://www.telerik.com/community/forums/silverlight/gridview/urgent-data-virtualization-issues-no-sorting-and-filtering.aspx

Waiting for your comments.

Regards,
Shiva
0
Vlad
Telerik team
answered on 15 Sep 2011, 01:44 PM
Hi,

 Please check our demos again to know more how we sort and filter. This should happen in ItemsLoading event before loading the data using Load() method. 

Greetings,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Kesav
Top achievements
Rank 1
answered on 22 Feb 2016, 09:26 PM

Hello Vlad,

We are having issue with updating the RadGridView. It is giving us the index out of range error and we analyzed that this is because, the rows are going out of view when the user scrolls. We are thinking of implementing virtual scrolling and our assumption is that in Virtual scrolling as the user scrolls the control loads data on demand whatever is loaded will be in memory and when we update the changes we will not be facing the index out of range issue.

Please let us know if our assumption right?

0
Martin
Telerik team
answered on 25 Feb 2016, 09:21 AM
Hi ,

 Could you please clarify whether you are working directly with visual elements?
If that is true, throwing IndexOutOfRandeException from RadGridView would be expected behavior. When UI Virtualization is turned on and the user scrolls, RadGridView reuses the existing containers for different data items, instead of creating new ones. When one item leaves the viewport, we unload it. 
Our recommended way to do that is to work not with the visual item but with the data item.

Regards,
Martin Vatev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
GridView
Asked by
Shiva
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Shiva
Top achievements
Rank 1
Kesav
Top achievements
Rank 1
Martin
Telerik team
Share this question
or