Search code examples
angularkendo-ui-angular2

How to add a class to a KendoUI Grid for angular2+ component base element?


Is there a way to easily add a class to a KendoUI Grid (for styling purposes)? So far I have tried using class and [ngClass] attributes, but it doesn't work.

<kendo-grid class="myClass" [ngClass]="'myNgClass'" ...>

outputs

<kendo-grid class="k-widget k-grid" ng-reflect-klass="myClass" 
    ng-reflect-class-name="k-widget k-grid" ...>

http://plnkr.co/edit/JWK9DvKoSiPm5XtbNNCI?p=preview


Solution

  • Indeed this is known issue with current implementation. Both class and ngClass should work on host element. We will address it shortly.

    As a temporary workaround you could wrap the Grid component in another element and cascade the rules through that element.