Поделиться через


PagedCollectionView.PageSize Property

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

Gets or sets the number of items to display on a page.

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

Syntax

'Declaration
Public Property PageSize As Integer
public int PageSize { get; set; }

Property Value

Type: System.Int32
The number of items to display on a page.

Implements

IPagedCollectionView.PageSize

Exceptions

Exception Condition
ArgumentOutOfRangeException

The page size is less than 0.

InvalidOperationException

The page size could not be changed because there is a new or edited item that could not be committed.

Remarks

If PageSize is 0, paging is disabled and all items in the collection will be displayed. Otherwise, items will be displayed on separate pages.

When the PageSize is changed, the PagedCollectionView will check for any newly added item or pending edit. If any pending transactions are found, the PagedCollectionView will temporarily reset the CurrentItem so that the bound control will commit or cancel the pending transactions. If any listeners to the CurrentChanging event cancel the CurrentItem change, or if a bound control does not successfully commit or cancel any pending transactions, an InvalidOperationException is thrown.

Version Information

Silverlight

Supported in: 5, 4, 3

Platforms

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