Skip to main content
A newer version of this page is available. .

DxGrid.PageSize Property

Specifies the maximum number of rows displayed on a page.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v22.1.dll

NuGet Package: DevExpress.Blazor

Declaration

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

Property Value

Type Default Description
Int32 10

The number of rows displayed on a page.

Remarks

Use the PageSize property to specify the maximum number of rows displayed on a page. If you set this property to 0 or a negative value, the Grid displays one row on each page.

@using Microsoft.EntityFrameworkCore
@inject IDbContextFactory<NorthwindContext> NorthwindContextFactory
@implements IDisposable

<DxGrid Data="@Data" PageSize="5">
    <Columns>
        <DxGridDataColumn FieldName="ShipName" />
        <DxGridDataColumn FieldName="ShipCity" />
        <DxGridDataColumn FieldName="ShipCountry" />
        <DxGridDataColumn FieldName="Freight" />
        <DxGridDataColumn FieldName="OrderDate" />
        <DxGridDataColumn FieldName="ShippedDate" />
    </Columns>
</DxGrid>

@code {
    object Data { get; set; }
    NorthwindContext Northwind { get; set; }

    protected override void OnInitialized() {
        Northwind = NorthwindContextFactory.CreateDbContext();
        Data = Northwind.Orders.ToList();
    }

    public void Dispose() {
        Northwind?.Dispose();
    }
}

Blazor Grid Page Size

The Grid displays the vertical scroll bar when the height of the Grid content exceeds the height of the component itself. On the image below, the Grid height is limited to 300px and the PageSize property is set to 30.

Blazor Grid Vertical Scrolling

You can also display the page size selector that allows users to change the page size at runtime.

Run Demo: Data Grid - Paging

Implements

See Also