Chapter 8. Providing DataGrid Pagination

IN THIS CHAPTER

  • Adding Paging Support to the DataGrid

  • Providing a More Elegant Paging Interface

  • Paging Through the DataGrid Using Custom Paging

  • Paging Through a Cached DataSet

  • On the Web

The examples we've looked at throughout the past seven chapters have displayed small amounts of data, usually around 25 database records. These examples displayed all of the data at one time. Although such an approach is sensible when dealing with manageable amounts of data, imagine if we displayed 500 database records all on one page. There would simply be too much data for the user to digest.

When presenting large amounts of data, many Web sites break the data up into pages. For example, doing a search for "DataGrid" on Google.com returns an estimated 114,000 results. Of course, I am not shown all 114,000 results at once, just 10 at a time. At the bottom of the page is a list of page numbers, allowing me to advance to the next page, or to one of the next 10 pages.

Google, obviously, is not the only Web site that breaks up large amounts of data into readable pages. All search engines do this, whether the search engine searches the entire World Wide Web or only a particular Web site. For example, searching for products by a keyword on Amazon.com will display all matching products 10 at a time.

In Chapter 7, "Sorting the DataGrid's Data," we looked at the DataGrid's built-in properties to aid with sorting. These included the AllowSorting property and the SortCommand event. As we'll see in this chapter, the DataGrid also provides a number of properties and events to assist with paging.



ASP. NET Data Web Controls Kick Start
ASP.NET Data Web Controls Kick Start
ISBN: 0672325012
EAN: 2147483647
Year: 2002
Pages: 111

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net