This documentation is archived and is not being maintained.

DataPager::Fields Property

Gets a collection of DataPagerField objects that represent the pager fields that are specified in a DataPager control.

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web.Extensions (in System.Web.Extensions.dll)

[PersistenceModeAttribute(PersistenceMode::InnerProperty)]
public:
virtual property DataPagerFieldCollection^ Fields {
	DataPagerFieldCollection^ get ();
}

Property Value

Type: System.Web.UI.WebControls::DataPagerFieldCollection
A collection object that contains all the pager fields that are specified in the DataPager control.

The pager fields are displayed in the DataPager control in the order that the pager fields appear in the Fields collection. The following table shows the pager field classes that derive from the DataPagerField class and that can be used in the Fields collection.

Pager field type

Description

NextPreviousPagerField

Enables users to navigate through pages of data one page at a time, or to jump to the first or last page of data.

NumericPagerField

Enables users to select a page of data by page number.

TemplatePagerField

Enables you to create a custom paging UI.

To declaratively specify the pager fields for a DataPager control, put a Fields element inside the DataPager control. You can then list the pager fields you want to include between the opening and closing <Fields> tags.

You can programmatically add pager fields to the Fields collection. However, it is easier to list the pager fields declaratively in the DataPager control.

The following example shows how to declaratively add pager fields to the Fields collection of a DataPager control.

No code example is currently available or this language may not be supported.

The following example shows how to use the Fields property to dynamically add a NextPreviousPagerField object to a DataPager control. This code example is part of a larger example provided for the NextPreviousPagerField constructor.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4, 3.5

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: