DataPager.PageIndex Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets or sets the index of the current page.

Namespace:  System.Windows.Controls
Assembly:  System.Windows.Controls.Data (in System.Windows.Controls.Data.dll)


<DefaultValueAttribute()> _
Public Property PageIndex As Integer
public int PageIndex { get; set; }
<sdk:DataPager PageIndex="int"/>

Property Value

Type: System.Int32
The index of the current page if the source is an IPagedCollectionView; otherwise, 0. The default is -1.


Exception Condition

Source is nulla null reference (Nothing in Visual Basic) or PageSize is 0, and PageIndex is not -1.


Source is not nulla null reference (Nothing in Visual Basic) or PageSize is not 0, and PageIndex is less than 0.


Dependency property identifier field: PageIndexProperty

If Source is nulla null reference (Nothing in Visual Basic), or if PageSize is 0, PageIndex must be -1. Otherwise, PageIndex must be greater than or equal to 0.

The source typically implements the IPagedCollectionView interface. In this case, PageIndex gets or sets the current IPagedCollectionView.PageIndex of the IPagedCollectionView.

If the source is a collection that implements IEnumerable<T> but not IPagedCollectionView, PageIndex returns 0.

Version Information


Supported in: 5, 4, 3


For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.