GridCustomizeElementEventArgs.CssClass Property
Specifies the name of a CSS class applied to a grid element.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v23.2.dll
NuGet Package: DevExpress.Blazor
Declaration
public string CssClass { get; set; }
Property Value
Type | Description |
---|---|
String | The CSS class name. |
Remarks
The example below demonstrates how to highlight a DxGrid row when a user hovers over the row:
<style>
.highlighted-item:hover, .highlighted-item:hover > td {
background-color: yellow;
}
</style>
<DxGrid Data="@forecasts" CssClass="mw-1100" CustomizeElement="OnCustomizeElement">
<Columns>
<DxGridDataColumn Caption="Date" FieldName="Date" />
<DxGridDataColumn Caption="Temperature" FieldName="TemperatureF" />
</Columns>
</DxGrid>
@code {
private WeatherForecast[]? forecasts;
void OnCustomizeElement(GridCustomizeElementEventArgs e) {
if(e.ElementType == GridElementType.DataRow)
e.CssClass = "highlighted-item";
}
}
For more information and examples, refer to the CustomizeElement event’s description.
See Also