Ok, I found a solution. I needed to use RowDatabound event and call args.Row.AddClass();
Similarly, to apply conditional formatting to cells, I need to use :
<GridEvents TValue="Item" QueryCellInfo="CustomizeCell" />
public void CustomizeCell(QueryCellInfoEventArgs<Item> args)
{
if (args.Column.Field == nameof(item.Id) && args.Data.Id < 10)
{
args.Cell.AddClass(new string[] { cellClass });
}
}