Virtual Page Count

2 posts, 0 answers
  1. Paydon
    Paydon avatar
    3 posts
    Member since:
    Mar 2017

    Posted 09 Mar 2017 Link to this post

    I have a potentially large database whom I'm trying to query for just the items I want displayed on the page I'm looking at. I understand how to use LINQ take and skip to grab the correct range for each page.

    What I am struggling with is setting the RadDataPager.PageCount to a value which would reflect the database's collection size and not the size of the collection in memory. I've tried binding ItemCount to a property that tracks the database collection size similarly to this my understanding ItemCount in combination with a PageSize binding should create the correct number of pages. I.E. 1 of X.

    The question then is; is it possible to set the PageCount to a value that is separate from the size of the collection that the RadDataPager is bound to? 

  2. Yoan
    Yoan avatar
    1142 posts

    Posted 14 Mar 2017 Link to this post


    Actually, DataPager's PageCount property is readonly and you can not set it. What you can try is to work with pager's ItemCount. I believe that an unbound DataPager will fit in your scenario. Please refer to the Unbound Mode help article which demonstrates how to do the paging outside of the DataPager via LINQ extension methods.

    Telerik by Progress
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Back to Top