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

DxGrid.PageIndex Property

Specifies the grid’s active page index.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v21.1.dll

NuGet Package: DevExpress.Blazor

Declaration

[Parameter]
public int PageIndex { get; set; }

Property Value

Type Description
Int32

A zero-based value that specifies the active page index.

Remarks

Use the PageIndex property to switch between Grid pages in code. You can handle the PageIndexChanged event to respond to page index changes.

@inject WeatherForecastService ForecastService

<DxGrid Data="@Data" PageSize="5"
        @bind-PageIndex="@GridPageIndex">
    <Columns>
        <DxGridDataColumn FieldName="Date" DisplayFormat="D" />
        <DxGridDataColumn FieldName="TemperatureC" Caption="@("Temp. (\x2103)")" Width="120px" />
        <DxGridDataColumn FieldName="TemperatureF" Caption="@("Temp. (\x2109)")" Width="120px" />
        <DxGridDataColumn FieldName="Forecast" />
        <DxGridDataColumn FieldName="CloudCover" />
    </Columns>
</DxGrid>

@code {
    object Data { get; set; }

    protected override void OnInitialized() {
        Data = ForecastService.GetForecast();
    }

    int GridPageIndex { get; set; } = 1;
}

Blazor Grid Page Index

Implements

See Also