Assuming pages and lines start with 1, and there is a fixed number of lines per page (say 10), you need to convert the page number and line into an index as follows:
Page 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 3 ...
Row 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 ...
↓
Index 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 ...
code:
int page = 2; int row = 2; int rowsPerPage = 10; IEnumerable<MyClass> source = ... MyClass result = source.ElementAt((page - 1) * rowsPerPage + (row - 1));
So, to get row 2 on page 2, you need to skip the first page (10 elements) and then take the second element (index 1 on this page).
source share