Datagrid paging using SQL - pulling back <n> records at a time with exact counts

Datagrid paging using SQL - pulling back <n> records at a time with exact counts

Post by dbarker » Fri, 29 Sep 2006 10:41:12


Hello All,

I am developing a web front end using the standard datagrid in the 1.1
framework. Currently it allows users to navigate through records 20 at
a time via previous and next buttons. This functionality is working
nicely and efficiently. I like this because I dont have to grab ALL the
records on each trip, just the next or previous 20. I am having a
terrible time creating the exact counts for the data grid navigation.
I use a method to get a count of the total records on the first initial
search. However creating the logic for building the exact count logic
while navigating forwards and backwards is tough. I would like to be
able to say "showing records 1-20 then 20-40 and then 40-43" (Assuming
the full search results in 43 records returned). Does anyone have (or
know of) a solid example of this. I know a lot of sites used this type
of functionality but I am not sure of the best approach. Any help
would
be greatly appreciated.