Skip to main content

DataRowInfo<T>.RowIndex Property

Returns a data row’s index.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v23.2.dll

NuGet Package: DevExpress.Blazor


public int RowIndex { get; }

Property Value

Type Description

A zero-based row index.


Use the RowPreviewTemplate‘s Context parameter to access the RowIndex property. This template allows you to show preview sections under each data row across all columns.

<DxDataGrid Data="@DataSource">
        <DxDataGridColumn Field="@nameof(Employee.FirstName)" SortOrder="DataGridColumnSortOrder.Ascending"></DxDataGridColumn>
    <RowPreviewTemplate Context="ItemInfo">
            Employee employee = ItemInfo.DataItem;
        @if (ItemInfo.RowIndex % 2 == 0) {
            <span class="mr-3">@employee.Notes</span>
        else {
            <span class="mr-3" style="color:darkblue;">@employee.Notes</span>
See Also