How to re-use kendoGridHeaderTemplate in kendo grid

942 Views Asked by At

It is possible to provide custom templates for heading of columns in Kendo grid, but I didn't find any possibilities to re-use this functionality.

Link to working fork from Kendo documentation - StackBlitz

Is it possible to extract kendoGridHeaderTemplate to one place and use it for all column headings?

I tried to add as kendoGridToolbarTemplate and it didn't work

Also I tried to use ngTemplateOutlet and it didn't work as well

1

There are 1 best solutions below

0
On BEST ANSWER

Doesn't seem to be a way to define a header template at one place. You could however reuse the template by rendering it with ngTemplateOutlet inside the column header template:

https://stackblitz.com/edit/angular-emwxk6-juzffl?file=app/app.component.ts