Cell text style for template column

Hi!

How can I change cell style of template column in the grid?

This is the grid:



and this is the template style:



and I want to change the text color like in the other cells with querycellinfo.



This is the current  result:



So, I want the template link in the column Polica to be in white color also.

Thanks!
Bernard.

3 Replies

BS Balaji Sekar Syncfusion Team December 4, 2020 01:21 PM UTC

Hi Bernard, 
 
Thanks for contacting Syncfusion support. 
 
We have validated the provided code example and screenshot. You can achieve your requirement by using the following way. Please find the code example for your reference. 
 
function queryCellInfo(args) { 
  if (args.data["OrderID"] % 2 == 0) { 
    args.cell.classList.add("e-cus"); // add the custom class for the specific element 
  } 
} 
 
 
In the above code example , we have added the custom class for the specific element based on that condition. Use following CSS to apply the own style for the specific element. 
 
<style> 
   .e-grid .e-cus.e-rowcell, 
   .e-cus.e-rowcell a{ 
      background-color:pink; 
      color: white 
    } 
        </style> 
 
Please get back to us, if you need further assistance 
 
Regards, 
Balaji Sekar 



BJ Bernard Jurlina December 4, 2020 01:31 PM UTC

Excellent!

It's working great.
Thanks Balaji!

Regards,
Bernard.


VS Vignesh Sivagnanam Syncfusion Team December 7, 2020 11:15 AM UTC

Hi Bernard, 

We are happy to hear that the provided solution works fine at your end. 

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

Regards, 
Vignesh Sivagnanam 


Loader.
Up arrow icon