GridView sorting paging : perform in db ?

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.)
 
P

Peter Bromberg [C# MVP]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top