System.Web.UI.WebControls.PagerSettings Class

Represents the properties of the paging controls in a control that supports pagination. This class cannot be inherited.

See Also: PagerSettings Members

Syntax

[System.ComponentModel.TypeConverter(typeof(System.ComponentModel.ExpandableObjectConverter))]
public sealed class PagerSettings : System.Web.UI.IStateManager

Remarks

Controls that support pagination (such as the System.Web.UI.WebControls.GridView, System.Web.UI.WebControls.DetailsView, and System.Web.UI.WebControls.FormView controls) can display a set of controls called the pager that allows the user to navigate the pages within the control. The System.Web.UI.WebControls.PagerSettings class is used by these controls to represent the properties of the pager. In general, the System.Web.UI.WebControls.PagerSettings object is stored in the PagerSettings property of the control. You can customize the pager by setting the properties of the System.Web.UI.WebControls.PagerSettings object.

The pager supports several different display modes. To specify the mode in which to display the pager, set the PagerSettings.Mode property. The following table describes the different modes.

PagerButtons.NextPrevious

Previous-page and next-page buttons.

PagerButtons.NextPreviousFirstLast

Previous-page, next-page, first-page, and last -page buttons.

PagerButtons.Numeric

Numbered link buttons to access pages directly.

PagerButtons.NumericFirstLast

Numbered-link, first-link, and last-link buttons.

When the PagerSettings.Mode property is set to the PagerButtons.NextPrevious, PagerButtons.NextPreviousFirstLast, or PagerButtons.NumericFirstLast value you can customize the text of the non-numeric buttons by setting the properties shown in the following table.

PagerSettings.FirstPageText

Text for the first-page button.

PagerSettings.PreviousPageText

Text for the previous-page button.

PagerSettings.NextPageText

Text for the next-page button.

PagerSettings.LastPageText

Text for the last-page button.

As an alternative, you can also display images for the non-numeric buttons by setting the properties as shown in the following table.

PagerSettings.FirstPageImageUrl

The URL to an image to display for the first-page button.

PagerSettings.PreviousPageImageUrl

The URL to an image to display for the previous-page button.

PagerSettings.NextPageImageUrl

The URL to an image to display for the next-page button.

PagerSettings.LastPageImageUrl

The URL to an image to display for the last-page button.

Note:

When an image property is set, the corresponding text property acts as the alternate text for the image. For example, when the PagerSettings.FirstPageImageUrl property is set, the text that is specified by the PagerSettings.FirstPageText property is displayed as the alternate text for the image. On browsers that support ToolTips, this text is also displayed as a ToolTip for the corresponding button.

When the PagerSettings.Mode property is set to the PagerButtons.Numeric or PagerButtons.NumericFirstLast value, you can specify the number of page buttons to display in the pager by setting the PagerSettings.PageButtonCount property.

The pager can be displayed at the top, the bottom, or both the top and bottom of a control. To specify the position of the pager, set the PagerSettings.Position property. To show or hide the pager, use the PagerSettings.Visible property.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0