tags:

views:

44

answers:

1

I have a 5000 items SORTABLE gridview. It splits them into pages of 20. Everything works perfectly, only looks like $%#%.

I have a pager that looks like:

1 | 2 | 3 | 4 ... 290

(The ... is real and not me being lazy for the sake of the question)

Now, I know for sure that people don't navigate beyond 6-7 pages but I need all the records in the grid for it to sort properly.

So I was wondering if anyone has a design idea what can I do with the pager (or a link to a website that implements it nicely).

+1  A: 

I think you should either:

  • Use ObjectDataSource or LinqDataSource (based on your data access, preferably LinqDataSource) and make it handle sorting and paging - this is the recommended way for simplicity and power.
  • Implement the sorting and paging server-side by yourself if this is very complex logic to get the data. You'll need to hook some grid events, etc, but there are many resources on this, search for gridview custom sorting and paging.

Note that the purpose of those two ways is to avoid the need to load all the rows, because this will slow down the application very much. You really need to handle the sorting and paging on the DB level!

Mohamed Meligy