Monday, December 22, 2003

Controlling the display of page numbers in a DataGrid ...

The DataGrid control contains built-in functionality to display its contents in pages. The number of items on the page is determined by the PageSize property. If no value is specified for the PageSize property, the DataGrid control displays 10 items on the page by default.

As the DataGrid would be dynamically populated, there is always the possibility of the number of records fetched to be less than the PageSize value. The DataGrid would then display the page number "1" by itself below the DataGrid. How would we avoid that is the question? Check out my article regarding this (which I wrote sometime in 2002) for further details.

No comments: