angularkendo-uikendo-gridkendo-ui-angular2kendo-ui-grid

How to re-use kendoGridHeaderTemplate in kendo grid


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


Solution

  • 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