Skip to main content

DxGrid.GetVisibleRowCount() Method

Gets the total number of visible rows in the grid.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

Declaration

public int GetVisibleRowCount()

Returns

Type Description
Int32

The number of visible rows.

Remarks

The GetVisibleRowCount method returns the number of visible rows displayed in all grid pages. This number includes data rows and group rows (if data is grouped), but does not include filtered out rows and rows in collapsed groups. Refer to Row Visible Indexes for more information.

@using Grid.Data
@inject WeatherForecastService ForecastService

<DxGrid Data="Data"
        @ref="MyGrid">
    <Columns>
        <DxGridDataColumn FieldName="Date"
                          DisplayFormat="D" />
        <DxGridDataColumn FieldName="TemperatureC" />
        <DxGridDataColumn FieldName="TemperatureF" />
        <DxGridDataColumn FieldName="Forecast"
                          GroupIndex="0" />
        <DxGridDataColumn FieldName="CloudCover" />
    </Columns>
</DxGrid>

<p />
<DxButton Click="OnGetVisibleRowCount">Get Visible Row Count</DxButton>
<p />
@Alert

@code {
    IGrid MyGrid { get; set; }
    object Data { get; set; }
    string Alert { get; set; }
    int count;

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

    void OnGetVisibleRowCount() {
        count = MyGrid.GetVisibleRowCount();
        Alert = "The visible row count equals " + count;
    }
}

Grid - Get Visible Row Count

For more information about paging in the Grid component, refer to the following topic: Paging in Blazor Grid.

See Also