ASPxGridViewPagerSettings.PageSize Property
Gets or sets the maximum number of rows that can be displayed on a page.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v21.2.dll
NuGet Package: DevExpress.Web
Declaration
Property Value
Type | Default | Description |
---|---|---|
Int32 | 10 | An integer value that specifies the number of rows. |
Property Paths
You can access this nested property as listed below:
Library | Object Type | Path to PageSize |
---|---|---|
ASP.NET MVC Extensions | GridViewSettings |
|
MVCxGridViewProperties |
|
|
ASP.NET Web Forms Controls | ASPxGridView |
|
GridViewProperties |
|
Remarks
Use the PageSize property to specify the maximum number of rows that can be displayed on a page. To display all the rows in a grid, set the ASPxGridViewPagerSettings.Mode property to GridViewPagerMode.ShowAllRecords. In this case, the PageSize property is not in effect.
End-users can change the page size by using the page size item element. To display all rows in a grid, end-users can click the All item in the page size item dropdown window, or click the All navigation button.
When a grid page size is changed by end-user interactions, the ASPxGridBase.PageSizeChanged event fires.
Note
When a grid displays all rows, the PageSize property returns the last specified numerical value.
Online Demos
Example
Web Forms approach:
<dx:ASPxGridView ID="Grid" runat="server" AutoGenerateColumns="False" Width="100%" DataSourceID="OrdersDataSource" KeyFieldName="OrderID">
<Columns>
...
</Columns>
<Settings VerticalScrollableHeight="300" />
<SettingsPager PageSize="20">
<PageSizeItemSettings Visible="true" ShowAllItem="true" />
</SettingsPager>
</dx:ASPxGridView>
MVC approach:
@Html.DevExpress().GridView(settings => {
settings.Name = "gvScrolling";
settings.Settings.HorizontalScrollBarMode = ScrollBarMode.Visible;
settings.Settings.VerticalScrollBarMode = ScrollBarMode.Visible;
settings.Settings.VerticalScrollableHeight = 200;
settings.SettingsPager.PageSize = 20;
...
}).Bind(Model).GetHtml()