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

How to expand child grid in ClientRowTemplate of Hierarchy Grid

3 Answers 239 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Victor
Top achievements
Rank 1
Victor asked on 22 Sep 2014, 08:58 AM
Hi experts,

First of all, sorry for asking some basic stuff about the grid as I'm quite new on the kendo grid.

As mentioned in the title, I would like to know how do I generate the link that expands the child grid from ClientRowTemplate.

What I'm doing now is altering the hierarchy.cshtml from the demo.  But not getting any luck to achieve this.

Many Thanks,

Victor

3 Answers, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 23 Sep 2014, 12:06 PM
Hello Victor,


You could add a link/button to the row which will invoke the expandRow method of the Grid API.
E.g.
columns.Bound(e => e.Title).ClientTemplate("<button class='expand'>Expand</button>");

$("#grid").on("click", ".expand", function () {
    var grid = $("#grid").data("kendoGrid");
    grid.expandRow(this);
});

Regards,
Dimiter Madjarov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Steve
Top achievements
Rank 1
answered on 06 Nov 2014, 02:27 AM
Dimiter,

Do you have an example of your reply that follows cshtml and/or razor format???   I've got the .Bound part but where does the $ part go?
0
Dimiter Madjarov
Telerik team
answered on 06 Nov 2014, 01:23 PM
Hello Steve,


The rest is a JavaScript code that should be included on the Grid page. For example in a script block.
E.g.
<script>
$("#grid").on("click", ".expand", function () {
    var grid = $("#grid").data("kendoGrid");
    grid.expandRow(this);
});
</script>

Regards,
Dimiter Madjarov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Victor
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Steve
Top achievements
Rank 1
Share this question
or