Skip to main content
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.v23.2.dll

NuGet Package: DevExpress.Web

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 MVC Extensions GridViewSettings
.SettingsPager .PageSize
MVCxGridViewProperties
.SettingsPager .PageSize
ASP.NET Web Forms Controls ASPxGridView
.SettingsPager .PageSize
GridViewProperties
.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.

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

Online Example

View Example: How to create a custom pager and display a page size item

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the PageSize property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also