GridView sorting paging : perform in db ?

  • Thread starter Thread starter John A Grandy
  • Start date Start date
J

John A Grandy

In regard to a GridView that must support searching, filtering, sorting, and
paging ...

There is a tradeoff in performing the sorting and paging in the database
versus to creating a CLR sort expression and allowing the GridView to
perform the sorting and paging.

How do people feel about each option for

(1) simple sorts (alphabetical, compound alphabetical)

(2) complex sorts (derived attributes, date-time manipulations, etc.)
 
It really depends on how many rows you have in the resultset that will be
paged.
If it is a manageable number. you can cache the results and simply rebind
the datasource based on the current page of results. If it is a very large
number of rows, this becomes inefficient because of the large number of
results and you'll be better off using custom paging via SQL RowNumber or
similar techniques. A simple google search on "Gridview Custom Paging" will
provide some good samples to study.
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short Urls & more: http://ittyurl.net
 
Back
Top