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

How to style individual cells of FluentDataGrid based on their value?

$
0
0

I have a Blazor Fluent-UI FluentDataGrid and I want to achieve a heatmap effect. Trying to avoid writing any JavaScript - is there any way I can apply styles to individual cells in order to achieve this?

As bare minimum example, this is the grid definition:

<FluentDataGrid Items="@Items?.AsQueryable()"><PropertyColumn Property="@(t => t.MyValue)" Format="F2" Title="Value"/></FluentDataGrid>

I would like to color individual cells based on the value of MyValue, since this number is already between 0 and 1. I was hoping I could achieve this with only css by using calc() to work out the heatmap colors, but how can I read MyValue for individual cells in the grid?

<PropertyColumn Class="heatmap" Style="--intensity: ????" Property="@(t => t.MyValue)" ...>

Any better approaches or help would be much appreciated, thanks.


Viewing all articles
Browse latest Browse all 4839

Trending Articles



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