0
votes

Im using EF 6.0 with an asp.net webform with a gridview. The grid is bound to an ObjectDatasource which gets its data from an entity data model. Paging works fine with skip and take, however when I sort a column, it wont keep my page#, it always goes back to page 1 since the startRowIndex parameter passed in is 0.

How can I keep the page number, yet sort the whole list?

1

1 Answers

1
votes

Starting from the first page when sorting is by design. The pages change logically when you re-sort. Page 6, for instance, no longer exists in the same sense as it did before you sorted.

I suppose you could get the page and move to that page in the data set, but wouldn't that confuse your user?