Hi,
I have a hierarchy grid which is filled by a model after a post action ("search").
In the search action i filled the model "Class" which contains an array of "Student".
I checked with debugger the search action and i found out that all of the data was loaded successfully, also the inner grids data.( I actually saw the data in the view)
The problem is that after the perfect first loading - surprisingly, the "search" action repeats itself for each inner-grid separately.
My question is: how to prevent reloading for each inner-grid?
This is my code:
@(Html.Kendo().Grid(Model.Class)
.Name("ClassGrid")
.Columns(column =>
{
column.Bound(c => c.CodeClass).ClientTemplate("<a> #=CodeClass# - #=ClassName#</a>");
column.Bound(c => c.NumOfStudents);
})
.Sortable()
.Groupable()
.ClientDetailTemplateId("HierarchyRows")
.Events(events => events.DetailInit("onDetailInit"))
.DataSource(data => data
.Ajax()
.PageSize(15)
.ServerOperation(false)
))
<script id="HierarchyRows" type="text/kendo-tmpl">
@(Html.Kendo().Grid<Models.Student>()
.Name("grid_#=NumStudent#")
.Columns(s=>
{
s.Bound(b => b.Age);
s.Bound(b => b.FirstName);
})
.Pageable()
.DataSource(data => data .Ajax()
.PageSize(5)
.ServerOperation(false)
)
.ToClientTemplate()
)
</script>
function onDetailInit(e) {
var gridDetail = $("#grid_" + e.data.NumStudent).data("kendoGrid");
gridDetail.dataSource.data(e.data.Classes);
}
I'll be glad to receive your help,
Elad.