This is a migrated thread and some comments may be shown as answers.

Using kendoGridCellTemplate inside dynamically generated columns

2 Answers 1741 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Rebekah
Top achievements
Rank 1
Rebekah asked on 15 Aug 2018, 06:54 PM

I have a grid where half of the columns are generated dynamically, but I need to add a tooltip to these columns. Normally I would use a kendoGridCellTemplate, but this doesn't seem to work with dynamic columns. I have tried a number of different things, but I'm not getting anywhere. 

<kendo-grid-column *ngFor="let block of dynamicBlocks" field="{{block.field}}" title="{{block.title}}" width="82">
<ng-template kendoGridCellTemplate>
{{THE FIELD VALUE}} --- what goes here?
</ng-template>
</kendo-grid-column>

2 Answers, 1 is accepted

Sort by
1
Accepted
Daniel
Telerik team
answered on 17 Aug 2018, 05:27 AM
Hello,

You can use approach similar to the one in the snippet below to show the value:
<ng-template kendoGridCellTemplate let-dataItem let-column="column">
  {{ dataItem[column.field] }}
</ng-template>


Regards,
Daniel
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Rebekah
Top achievements
Rank 1
answered on 17 Aug 2018, 01:38 PM
Thank you! This is exactly what I needed. I definitely recommend this go somewhere in the official documentation. 
Tags
General Discussions
Asked by
Rebekah
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Rebekah
Top achievements
Rank 1
Share this question
or