View Single Post
  #9 (permalink)  
Old July 20th, 2007, 07:48 AM
planoie's Avatar
planoie planoie is offline
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

If you use custom paging you need to provide the right page data and the page count. This is useful if you have a query that handles the paging. A good example of this would be if you have a huge table, lets say 1 million records. The normal behavior of the paging .NET controls is to take all the data from the query and determine the page count based on your page size and show the records for that page. This means that you are transferring 1 million records EVERY TIME you bind the grid. This is very inefficient. So you write a query/sproc that calculates the pages and the returns just the records for that page (say 10). But now you need to convey to the control how many pages there are and pass the current page index to the query.

Initially, start simple, turn custom paging off and let the control handle the paging logic for you while you are getting it working, then take it from there.

-Peter
Reply With Quote