DataGridHtmlRowDecorationEventArgs<T>.Selected Property

Specifies whether the processed row is selected.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v21.1.dll

Declaration

public bool Selected { get; }

Property Value

Type Description
Boolean

true if the row is selected; otherwise, false.

Remarks

The code below uses the HtmlRowDecoration event to mark the selected grid row’s text with bold.

<DxDataGrid DataAsync="@ForecastService.GetForecastAsync"
            PageSize="5"
            HtmlRowDecoration="@OnHtmlRowDecoration">
    <DxDataGridCommandColumn />
    <DxDataGridDateEditColumn Field="@nameof(WeatherForecast.Date)" DisplayFormat="D" EditorFormat="D" />
    <DxDataGridColumn Field="@nameof(WeatherForecast.Forecast)"  />
    <DxDataGridSpinEditColumn Field="@nameof(WeatherForecast.TemperatureC)" Caption="@("Temp. (\x2103)")" />
    <DxDataGridComboBoxColumn Field="@nameof(WeatherForecast.CloudCover)" 
        DataAsync="@ForecastService.GetCloudCoverAsync" />
    <DxDataGridCheckBoxColumn Field="@nameof(WeatherForecast.Precipitation)" />
</DxDataGrid>

@code {
    void OnHtmlRowDecoration(DataGridHtmlRowDecorationEventArgs<WeatherForecast> eventArgs) {
       if (eventArgs.Selected)
            eventArgs.CssClass += " font-weight-bold";
    }
}

DataGird Row Decoration Selected

See Also