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

Column header of row expander in grid

1 Answer 156 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Andy
Top achievements
Rank 1
Andy asked on 18 Nov 2014, 11:22 PM
I have a grid that has a row expander for the detailsTemplate. I want to know how I can change the column header of the row expander to be something like

<span ng-click="myfunction()">Click here</span>

Right now the column header is blank.

1 Answer, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 20 Nov 2014, 04:32 PM
Hi Andy,

I am afraid that what you would like to achieve is not supported out of the box. The Grid widget does not provide opportunity for changing the column header of the row expander column via template.
My recommendation is to hook up to the click event and change the text of the cell manually, using jQuery.

To achieve that use the kendoWidgetCreated event which fires after the Grid is rendered. Then you may select the cell via class:

//in the kendoWidgetCreated event
 
grid.thead.find("th.k-hierarchy-cell").text("Click here").on("click", function() {
  //the click event handler
});

Where 'grid' holds a reference to the Kendo Grid widget instance.

Regards,
Alexander Valchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Andy
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Share this question
or