This is a migrated thread and some comments may be shown as answers.

Conditional Cell Class

1 Answer 1182 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jose
Top achievements
Rank 1
Jose asked on 29 May 2018, 12:51 PM

Hi Team,

I am using attribute for column definition like below and giving class for entire column. But not getting how to give cell class based on condition like for index 3 I wanted class for particular column cell.

attributes: { "class": "my-class"},

 

Thanks in Advance,

Jose

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 31 May 2018, 05:48 AM
Hello, Jose,

Thank you for the details.

This could be achieved but it will require looping through all cell on the dataBound event and programmatically set the class based on a value:

https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/methods/dataitem

https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/events/databound

I made an example demonstrating this:

https://dojo.telerik.com/oYigUwOn

I hope this is helpful.

Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Jose
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or