Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

MudTable - How to set cell color

$
0
0

I need a way to color a selected cell, e.g. if its value is greater than something. I know how to color an entire row in a table.

    private string TblRowStyle(Planowanie thing, int index)    {        if (thing.tydzien == tydzien)        {            return $"background: #D3D3D3";        }        else        {            return "";        }    }
<MudTable T="Planowanie" Items="@planowanie" FixedHeader="true" Height="@(fixed_header  ?"800px":"")" CustomHeader="true" CustomFooter="true" Dense="true" Hover="true" Bordered="true" Striped="true" Breakpoint="Breakpoint.Sm" MultiSelection="false" RowStyleFunc="@((item, idx) => TblRowStyle(item, idx))" >

is coloring the entire row in the table.However, I need to set the colour of text in the cell conditionally, when the value is greater than something else.


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>