3

In the kendo grid component for angular, how do I achieve something akin to the following?

<kendo-grid-column field="value" [class]={'danger': dataItem.value > 30}>
</kendo-grid-column>

I know I can put a template inside the kendo-grid-column and that template has access to the dataItem, but that only allows me to set a class on elements in the template and not on the td itself.

noah
  • 81
  • 3

1 Answers1

0

Please try using ngClass like that:

<kendo-grid-column field="value" [ngClass]="(dataItem.value > 30) ? 'danger': ''">
</kendo-grid-column>
Giannis
  • 1,790
  • 1
  • 11
  • 29