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)

public:
[PersistenceModeAttribute(PersistenceMode::InnerProperty)]
property DataPagerFieldCollection^ Fields {
	virtual 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
Available since 3.5
Return to top
Show: