Paint negative numbers red

Hi Guys,

With the SFGrid in blazor web, how do I paint the column values red ( text) when numbers are negative.


Thanks


3 Replies

NP Naveen Palanivel Syncfusion Team September 20, 2023 01:41 AM UTC

Hi Patel

Greetings from Syncfusion support


We checked your query, we can customized the cell by using the QueryCellInfo event of the grid to achieve your requirement and we have already discussed about this  similar topics detailly in our UG documentation. Kindly refer  the documentation , simple sample and screenshot for your reference.


Reference: https://blazor.syncfusion.com/documentation/datagrid/cell#customize-cell-styles

Sample : https://blazorplayground.syncfusion.com/embed/BZrAZEMYJxGJfLDJ?appbar=true&editor=true&result=true&errorlist=true&theme=bootstrap5


Please let us know if you have any concerns.


Regards,

Naveen Palanivel



SP Sandip Patel September 20, 2023 05:02 AM UTC

I wanted to change the text color not the background color.


Thanks



NP Naveen Palanivel Syncfusion Team September 22, 2023 02:16 AM UTC

Hi Patel,

Based on your query, it seems that to change the text color instead of the background color. We achieved your requirement by using CSS style . Please refer the modified sample for your reference

Sample : https://blazorplayground.syncfusion.com/embed/BXVUNuLrtvXZkvxM?appbar=true&editor=true&result=true&errorlist=true&theme=bootstrap5

Please let us know if you have any concerns.


Regards,

Naveen Palanivel


Loader.
Up arrow icon