Tab

ASPxGridViewPagerSettings.PageSize Property

Gets or sets the maximum number of rows that can be displayed on a page.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v20.2.dll

Declaration

[DefaultValue(10)]
public int PageSize { get; set; }

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 Controls and MVC Extensions ASPxGridView
.SettingsPager.PageSize
GridViewProperties
.SettingsPager.PageSize
ASP.NET Bootstrap Controls BootstrapGridView
.SettingsPager.PageSize
BootstrapGridView
.SettingsPager.PageSize
ASP.NET MVC Extensions GridViewSettings
.SettingsPager.PageSize
GridViewSettings<RowType>
.SettingsPager.PageSize
MVCxGridView
.SettingsPager.PageSize
MVCxGridViewProperties
.SettingsPager.PageSize
MVCxGridViewProperties
.SettingsPager.PageSize

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()
See Also