Enabling Paging

The Sales By Category view in the Northwind sample database returns over 80 rows of data—far too many to display on one page. When you initially set up the DataGrid control, you changed the AllowPaging property to True. This causes, by default, 10 rows of data to be sent out for each page. At the bottom of the grid you see paging links (by default, < and >). Once you've added a little code, you can use these links to page through the data, 10 rows at a time. You can also change the number of rows per page by setting the PageSize property of the DataGrid control. In addition, you can change the style of the paging indicators (adding page numbers rather than simple Next and Previous links). If you want to allow users to page using ...

Get ASP.NET Developer's JumpStart now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.