JavaScript UI Libraries & Blazor Components Suite – Smart UI › Forums › Data Grid › Cell background colour Blazor › Reply To: Cell background colour Blazor
Don’t need row templates. I have tried using a column template but there doesn’t appear to be anyway to inject the {{value}} into the background-color attribute of the div – and that is what I need. value has the format #FFFFFF
This is fine if the background-color is fixed at compile time as per all of the examples:
<div style=”padding: 4px; background-color: #AABBCC; “>{{value}}</div>
I need to inject the {{value}} into the background-color (replacing the hard-coded #AABBCC). This throws a compile error:
<div style=”padding: 4px; background-color: {{value}}; “></div>
If you believe this is possible then please post the code.
I have tried attribute splatting but this only moves the problem into how do I inject the {{value}} into the function parameter.