Change cell appearance based on condition

Hi,

I've setup my grid and filled it with data. Now I want to highlight some of these datas whenever a user perform a certain check on the dataset.
After reading several posts (like thisthat and this one), I still couldn't achieve my goals.
If I would like to change the font color of a cell, I would assign a hard coded string to the style:color attribute. Or I could change the css by overriding the values in a style section. This, on the other hand, affects all cells. 
What I want to achieve is changing border, font and color attributes by adding a css class of my own. 

I tried jQuery like $(cell).addClass("myClass"); and $(cell.style).addClass("myClass"); but I doesn't work.
What's the preferred way to do this? The grid is already initialized and the check on the dataset is fired by a button event or whatever.



3 Replies

KM Kuralarasan Muthusamy Syncfusion Team March 9, 2018 12:54 PM UTC

Hi Dave, 

Thanks for contacting Syncfusion support.  

We have analyzed your query and we found that you want to highlight some data’s in Grid. So we suggest you to QueryCellInfo event to highlight the data in the Grid. 

We have already discussed about this topic in kb, Please refer the following link to kb document: 

Please refer the following link to know about QueryCellInfo event of Grid: 



If you need further assistance please get back to us, 


Regards, 
Kuralarasan M. 



DT Dave Tchizo March 9, 2018 08:27 PM UTC

Hi,

thanks for your reply. I got it working by applying the jQuery css function to a cell.


KM Kuralarasan Muthusamy Syncfusion Team March 12, 2018 09:43 AM UTC

Hi Dave,  

We are happy to hear that your problem has been solved. Please let us know if you need further assistance. 

Regards, 
Kuralarasan M.  


Loader.
Up arrow icon