i

ASP.Net A Complete Guide

DataPager

To display the data item in pages (for paging), we use another ASP.NET control DataPager with ListView control. The DatePager control provides paging for data-bound ASP.NET controls that implement the IPageableItemContainer interface, such as the ListView control.

Pager Fields

To display navigation controls, the pager fields are used.

Pager field

Description

NextPreviousPagerField

Enables users to navigate through pages or to jump to the first or last page.

NumericPagerField

Enables users to select a page number.

TemplatePagerField

Enables us to create a custom template paging UI.

Page Properties

The following table lists the read-only properties of the DataPager control that indicates the characteristics of the page of the data. That properties are usually used for binding expressions in the TemplatePagerField object.

Property

Description

MaximumRows

The maximum records display for the page of data.

StartRowIndex

The first record’s index displayed on a page of data.

TotalRowCount

The total number of records in the data source.

In the image below, you can see the "DataPager” control.

Syntax: