Skip to main content

DataPager Class

The Data Pager.

Namespace: DevExpress.Xpf.Editors.DataPager

Assembly: DevExpress.Xpf.Core.v14.2.dll

#Declaration

public class DataPager :
    Control

#Returned By

The DataPager.GetDataPager(DependencyObject) method returns an instance of DataPager.

#Remarks

The Data Pager provides paging functionality for data-bound controls (e.g. GridControl, TreeListControl, etc.) that implement the System.ComponentModel.IPagedCollectionView interface. A source collection should be assigned to the DataPager.Source property. If this collection does not implement System.ComponentModel.IPagedCollectionView, the Data Pager wraps it to a paged collection that can then be accessed via the DataPager.PagedSource property.

The Data Pager supports multiple display modes that specify which buttons are to be displayed (DataPager.DisplayMode). In several modes, the Data Pager displays numeric buttons with or without navigation buttons. Clicking a numeric button switches to the corresponding page. The number of numeric buttons is specified by the DataPager.NumericButtonCount property. If the total number of pages is greater than the number of numeric buttons and the DataPager.AutoEllipsis property is set to true, the outside left and/or right numeric buttons display an ellipsis.

DataPagerAndGrid

The page size is specified by the DataPager.PageSize property. The total number of pages can be obtained via the DataPager.PageCount property. Enable the DataPager.ShowTotalPageCount option to display the total number of pages and an editable area allowing the end-user to specify the active page.

To obtain which page is currently active, use the DataPager.ActualPageIndex property. To specify the active page in code, use DataPager.PageIndex. Before the active paged is changed, the Data Pager fires the DataPager.PageIndexChanging event, allowing you to cancel the action. After the active page has been changed, the DataPager.PageIndexChanged event is raised.

See Also