How to do virtual scrolling in RadGrid??

9 posts, 0 answers
  1. Shiva
    Shiva avatar
    61 posts
    Member since:
    Oct 2010

    Posted 14 Sep 2011 Link to this post

    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
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 15 Sep 2011 Link to this post

    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 >>

  3. DevCraft banner
  4. Shiva
    Shiva avatar
    61 posts
    Member since:
    Oct 2010

    Posted 15 Sep 2011 Link to this post

    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
  5. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 15 Sep 2011 Link to this post

    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 >>

  6. Shiva
    Shiva avatar
    61 posts
    Member since:
    Oct 2010

    Posted 15 Sep 2011 Link to this post

    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
  7. Shiva
    Shiva avatar
    61 posts
    Member since:
    Oct 2010

    Posted 15 Sep 2011 Link to this post

    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
  8. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 15 Sep 2011 Link to this post

    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 >>

  9. Kesav
    Kesav avatar
    1 posts
    Member since:
    Feb 2016

    Posted 22 Feb Link to this post

    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?

  10. Martin Vatev
    Admin
    Martin Vatev avatar
    90 posts

    Posted 25 Feb Link to this post

    Hi Kesav,

     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
Back to Top
DevCraft banner