New to Kendo UI for Angular? Start a free 30-day trial
Change Grid Styling When Sorting is Applied
Updated on Jan 20, 2026
Environment
| Product | Progress® Kendo UI for Angular Grid |
Description
How can I change the styles of the Kendo UI for Angular Grid columns and headers when sorting is applied?
Solution
To change the styles of the active Grid columns when sorting is applied:
-
Use the
sortChangeevent of the Grid to update theSortDescriptor.html<kendo-grid> ... (sortChange)="onSortChange($event)" ... </kendo-grid>typescriptpublic onSortChange(sortDesc: SortDescriptor[]): void { this.sortDescriptors = sortDesc; } -
Use the
classandheaderClassproperties of theColumnComponentto conditionally apply a custom class if the columns field is present in theSortDescriptor.html<kendo-grid-column field="ProductName" title="Product Name" [headerClass]="{'is-col-sorted': isColumnSorted('ProductName')}" [class]="{'is-col-sorted': isColumnSorted('ProductName')}"> </kendo-grid-column>typescriptpublic isColumnSorted(colField: string): boolean { return this.sortDescriptors.some((col) => col.dir && col.field === colField); } -
Use the custom class to apply the desired styles to the sorted columns.
css.is-col-sorted { background-color: #FBEAEB!important; color: #2F3C7E; }
The following example demonstrates the suggested approach.
Change Theme
Theme
Loading ...