Pagination
Table Of Contents
What Is Pagination?
Pagination in short means dividing the results into chunks of a determinate size called Pages.
Then pulling only one of those Pages at time.
Subsequently, pulling the next or the previous page as needed.
For example on a screen that displays orders. And the total number of orders are 1 million but you only want to display 10 at a time.
Pagination And Query
Paging or Pagination can be used to build your Query instance.
To learn about how to craft the Query instance go to the Filtering section of the documentation.
You can also check out the Query Syntax section of the documentation.
Using Pagination
Pagination is disabled by default.
To enable paging you must configure it by calling these methods in your Query instance:
-
PageSize: takes an integer that specifies the number of records to fetch per page.
-
PageNumber: takes an integer that specifies which page to return. The first page is 1.
-
ReturnTotalCount: takes a boolen.
If true the properties PageCount and RecordCount of the Query instance will be populated after the query is executed.
The default value is false.
The below code sample shows how to retrieve the second page of the results with a page size of 25 from the Orders table.