Change font color on datagrid

I try to change row color based on value using CellRender Event.

When I check the html line of row, it add successfully however it doesn't show it. It adds to the parent like below. How can i change the font-color?

image

Here is the code part;

        protected void renderCell(DataGridCellRenderEventArgs<Lists.list_databases> args)
        {
            if (args.Data.STATUS == "online")
            {
                args.Attributes.Add("style", $"color: {("green")};");
            }
            else
            {
                args.Attributes.Add("style", $"color: {("red")};");

            }
        }

The text color is specified by the rz-cell-data class in the themes. This is why setting it at td level won't work. You can use a column template as in our demo:

            <Template Context="data">
                @if (data.Quantity > 20)
                {
                    <span style='color: green'>@data.Quantity</span>
                }
                else
                {
                    <span style='color: red'>@data.Quantity</span>
                }
            </Template>

Thanks for the reply. It works on cell.

However i want to change whole row font color depending on the column value. is that possible?