RadzenDataGrid row styling (even/odd)

Dear community,

In the older versions of Radzen.Blazor the rows of the RadzenDataGrids were separated by two classes :

  • rz-datatable-even

  • rz-datatable-odd

These two allowed me to do specific styling every other column like that :
image
image

After updated the blazor to the last version stable (v. 4.1.15) I see that now all rows have only the "rz-data-row" class. How can I now apply a specific styling in every other column like before ?

Thank you in advance

Hi @AlxFigueiredo,

The easiest way would be to set the --rz-grid-stripe-background-color CSS variable to the desired alternating row color. If you want to do that for all DataGrids you can use

.rz-datatable {
 --rz-grid-stripe-background-color: #333333;
}

We now use the nth-child selector to style alternating rows as it comes as a built-in feature. Here is the actual implementation: radzen-blazor/_grid.scss at master ยท radzenhq/radzen-blazor ยท GitHub

1 Like

Hi @korchev,

It worked perfectly !

Thank you for the additional informations !