Having Hierarchy grid, trying to add custom client template with and item with it. But, don't know how can i get child item. For ex. on parent grid i'm getting item like:
.Columns(columns =>
{
columns.Template(e => { }).ClientTemplate("<strong><a href='" + Url.Action("Details", "Types") + "#= Id #'> #= Name # </a></strong>").Title("Type Name").Width("30%");
How can I make this the same for child grid?
.Name("grid_#=Id#")
.Columns(columns =>
{
columns.Bound(e => e.Name).Title("SubType Name").ClientTemplate("<a href='" + Url.Action("Details", "Types") + "#= e.data.Id #'>#= e.data.Name #</a>");
If I will use like: #= data.Name #
it will display parent data.
When you use the #= YOUR CODE # syntax in the child grid, it's executed at the parent level, that's why you get the parent model properties.
To have your code executed at the child level, you must use this syntax : \\# YOUR CHILD CODE \\#
This allows you to mix the use of properties from either parent or child level