Hi, I'm trying to change the whole row background colour to a certain colour if a certain condition is met.
My conditions are:
If status is text "Failure", the whole row should turn red colour background with white text or something.
else, do nothing.
Here is what I've tried so far:
<RadzenGrid @ref="serversGrid" AllowFiltering="true" FilterCaseSensitivity="Radzen.FilterCaseSensitivity.CaseInsensitive"
AllowPaging="true" AllowSorting="true" Data="@serverData" TItem="ServerDTO"
ColumnWidth="200px" RowUpdate="@OnUpdateRow" PageSize="10" RowRender="@RowRender">
<Columns>
<RadzenGridColumn TItem="ServerDTO" Property="Status" Title="Status">
<EditTemplate Context="server">
<RadzenDropDown @bind-Value="server.Status" Data="@statusList" Style="width:100%" />
</EditTemplate>
</RadzenGridColumn>
</Columns>
As you can see I have my RowRender in the grid, now I have this as well:
void RowRender(RowRenderEventArgs<ServerDTO> args)
{
args.Attributes.Add("style", $"background-color: {(args.Data.Status.Equals("Failure") ? "Red" : "White")};");
}
Im doing this and its not working? Is my syntax incorrect? I'm getting no errors when I run but its not turning red when the value of status is failure
Any help is appreciate thank you!