Dynamic background color on grid cell

Hello,

I want to set background color of some grid cells according to the hex that is mentioned in them.
The cell text is ex. "ffc107" and I want to make the background color of that cell to match the hex value.
I have tried using the customAttributes property but I have not found any way to achieve the wanted outcome.
If someone knows how to achieve this I would be super glad to know!

Best regards!

3 Replies 1 reply marked as answer

TS Thiyagu Subramani Syncfusion Team April 29, 2021 12:46 AM UTC

Hi Spyros, 

Thanks for contacting Syncfusion forum. 

Based on your shared information we suspect that you want to set background color for Grid cell based on its value. For this we have already explained this requirement in below documentation link. Please refer it.  By default the appearance of cells can be customized by using the queryCellInfo event. The queryCellInfo event triggers for every cell. In that event handler, you can get QueryCellInfoEventArgs that contains the details of the cell. 


Please get back to us, if you need any further assistance. 

Regards, 
Thiyagu S 


Marked as answer

SP Spyros April 29, 2021 07:15 PM UTC

Thank you very much for the help, with your assistance and several tries I figured out how exactly to do what I needed!



TS Thiyagu Subramani Syncfusion Team April 30, 2021 04:57 AM UTC

Hi Spyros, 

Thanks for your update. 

We are happy to hear that the provided solution helps to achieve your requirement.  

Please get back to us, if you need any further assistance 

Regards, 
Thiyagu S. 


Loader.
Up arrow icon