Skip to main content
Tab

ASPxDataViewBase.PageSizeChanging Event

Fires on the server side before the page size (number of items per a page) is changed by end-user interactions and allows you to cancel the action.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v23.2.dll

NuGet Package: DevExpress.Web

Declaration

public event DataViewPageSizeEventHandler PageSizeChanging

Event Data

The PageSizeChanging event's data class is DataViewPageSizeEventArgs. The following properties provide information specific to this event:

Property Description
Cancel Gets or sets a value indicating whether the event should be canceled. Inherited from CancelEventArgs.
NewPageSize Gets or sets the new page size (number of items displayed on a page).

Remarks

End-users can change the page size (the number of items displayed on a page) using the page size item element of the embedded pager. Additionally, the All navigation button can be used to display all items.

The PageSizeChanging event allows you to perform any custom actions before the page size is changed by end-user interactions. You can use the event parameter’s properties to identify a new page size (DataViewPageSizeEventArgs.NewPageSize) or to cancel the operation by setting the Cancel property to true.

Note

When the ASPxDataView.Layout (ASPxImageGallery.Layout) property is set to Table, the DataViewPageSizeEventArgs.NewPageSize property returns the maximum number of rows that can be displayed on a page.

When the ASPxDataView.Layout (ASPxImageGallery.Layout) property is set to Flow, the DataViewPageSizeEventArgs.NewPageSize property returns the maximum number of items that can be displayed on a page.

If an end-user clicks the All item in the page size item dropdown, or the All navigation button, the DataViewPageSizeEventArgs.NewPageSize property returns the previous numerical value.

After the page size has been changed, the ASPxDataViewBase.PageSizeChanged event is raised.

See Also