DataGridHtmlRowDecorationEventArgs<T>.Level Property

The nesting level of the processed group row.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v21.1.dll

Declaration

public int Level { get; }

Property Value

Type Description
Int32

An integer value that specifies the nesting level of a grid row.

Remarks

The nesting level determines how many group rows you must expand to reach the processed row from the root. The root row’s Level is 0. The Level of its children is 1, etc.

DataGrid Row Level

<DxDataGrid Data="@Vacancies" ShowGroupPanel="true" HtmlRowDecoration="@OnHtmlRowDecoration">
    <DxDataGridColumn Field="@nameof(Vacancy.Id)" Width="70px" AllowGroup="false"></DxDataGridColumn>
    <DxDataGridColumn Field="@nameof(Vacancy.Description)"></DxDataGridColumn>
    <DxDataGridComboBoxColumn Field="@nameof(Vacancy.Region)" Data="@VacancyRepository.Regions" GroupIndex="0"></DxDataGridComboBoxColumn>
    <DxDataGridColumn Field="@nameof(Vacancy.City)" GroupIndex="1"></DxDataGridColumn>
</DxDataGrid>

@code {
    IEnumerable<Vacancy> Vacancies;

    protected override async Task OnInitializedAsync() {
        Vacancies = await VacancyRepository.GetVacancies(100);
    }

    void OnHtmlRowDecoration(DataGridHtmlRowDecorationEventArgs<Vacancy> eventArgs) {
        switch (eventArgs.Level) {
          case 0:
              eventArgs.CssClass += " table-primary";
              break;
          case 1:
              eventArgs.CssClass += " table-secondary";
              break;
          case 2:
              eventArgs.CssClass += " table-light";
              break;
          default:
              eventArgs.CssClass += " table-reflow";
              break;
        }
    }
}
NOTE

This property has no effect and returns 0 for detail rows.

See Also