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:
- Working code/example of implementing virtual scrolling. This includes both xaml and xaml.cs code.
- Link of any online resource available for this concept.
- Can we govern how many rows will be visible initially when the grid loads?
- Any disadvantage of virtual scrolling in terms of performance of the Silverlight page?
- 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
You can check our virtual collection for more info:
http://demos.telerik.com/silverlight/#DataVirtualization/FirstLook
Vlad
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
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
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 >>
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
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
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 >>
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?
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