Search code examples
angulartelerikangular6kendo-grid

Custom Styling not getting applied to the kendo grid in Angular 6


Hi I am trying to add custom styling to the selected rows in kendo grid, but it is not getting applied.

Following is my code in css file of that component

:host ::ng-deep .modal-dialog .k-grid td.k-state-selected, .k-grid tr.k-state- 
 selected>td {
background-color:lightgreen;
}

I had contacted telerik support they asked me to add encapsulation:ViewEncapsulation.None in ts file but after adding that the style is getting applied for all the components, so i am not able to find why its not getting applied.

In one of the question on stackoverflow i found :host ::ng-deep by adding this it will work so i tried but still its not working.

My Kendo-Grid is on Bootstrap Modal Popup.


Solution

  • it worked for me by doing following changes

    :host ::ng-deep .modal-dialog .k-grid td.k-state-selected,:host ::ng-deep .k-grid tr.k- 
    state-selected>td {
    background-color:lightgreen;
    }