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


public sealed class PagerSettings : System.Web.UI.IStateManager


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.


Previous-page and next-page buttons.


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


Numbered link buttons to access pages directly.


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.


Text for the first-page button.


Text for the previous-page button.


Text for the next-page button.


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.


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


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


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


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


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.


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