Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

How to Use Skip Tokens to Optimize Paging

This topic presents examples that demonstrate how to use skip tokens to optimize paging.

#Complete Examples

#Remarks

Using skip tokens, you can get the next page based on the previous one. It improves the performance of obtaining the next page.

In the following code sample, the lastId is a skip token:

var firstPage = queryable
    .OrderBy(x => x.Id)
    .Take(20)
    .ToArray();

var lastId = firstPage.Last().Id;
var secondPage = queryable
    .Where(x => x.Id > lastId)
    .OrderBy(x => x.Id)
    .Take(20)
    .ToArray();