Trying to format datagrid row not just the cell

I found this Datagrid change row Color based on value in row - #2 by enchev

I'm needing to hightlight the row if they are set to primary when tried the above solution I'm getting an error that datatable is not found

RadzenDataGrid<DisplayMemberAddress> DisplayMemberAddressesGrid;

 protected override void OnInitialized()
    {
        this.DisplayMemberAddressesGrid.dataTable.rowStyleClass = (data, index) => {
            return data.Id >= 3 ? 'class1' : 'class2';
        }
    }

With the solution dated back to 2019, I'm wondering if the backend has changed and if I need to modify this example. Also, I want to confirm whether this needs to be configured before or after data is loaded to the list object.

I've also noticed that if I want to add CSS for the table, I need to add it to the site.css file for it to be read. For some reason, the component.SS file doesn't work, and I have to put it inside the component directly for the CSS to be recognized.

The linked thread is about Angular. Check this demo instead. It uses the RowRender event.

this is applying the style

But it's not updating the data grid. I have a basic table to build out to get my CSS right (top table), and now I'm updating it to a data grid. Images below shows what I'm getting with the current row render ( data-grid is the bottom table ) ( this is work-related some have to be picky with the screenshots to for PII concerns, which is why I'm only showing the type column

basic table if block


data grid

inspect

I've cleared Bowser's cache twice. I'm not sure why CSS isn't being applied

Because <td> background is set through the theme. You can use the CellRender event to set it (also demonstrated in the linked demo).

Thanks for the help!!