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

Virtual Page Count

1 Answer 187 Views
DataPager
This is a migrated thread and some comments may be shown as answers.
Paydon
Top achievements
Rank 1
Paydon asked on 09 Mar 2017, 09:13 PM

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 http://www.telerik.com/forums/itemcount-binding.To 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? 

1 Answer, 1 is accepted

Sort by
0
Accepted
Yoan
Telerik team
answered on 14 Mar 2017, 10:49 PM
Hi,

Actually, DataPager's PageCount property is 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.

Regards,
Yoan
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.
Tags
DataPager
Asked by
Paydon
Top achievements
Rank 1
Answers by
Yoan
Telerik team
Share this question
or