I have a weird problem with a detailed template in a Kendo grid. I have two levels of deep detail templates, and it worked most of the time (oddly enough, how it sounds). Sometimes the deepest grid does not bind data from the server without any errors. When looking at Firebug, I see that the Json response clearly responds with the correct data, however the grid does not bind the data (at least the css class shows "t-no-data" in the markup). Let me be clear, although this happens sometimes, not always. I tried to figure out when this would happen, but I could not find anyone. Here is an example of my code:
<div>
@(Html.Kendo().Grid<DepObject>()
.Name("DepartmentGrid")
.Columns(c =>
{
c.Bound(e => e.DepartmentCode).Hidden();
c.Bound(e => e.DepartmentName);
})
.ClientDetailTemplateId("CesTmp")
.DataSource(d => d.Ajax().Model(model => model.Id(p => p.DepartmentCode)))
.Scrollable(s => s.Enabled(true))
)
</div>
<script id="CesTmp" type="text/kendo-tmpl">
@(Html.Kendo().Grid<CesObject>()
.Name("CesGrid_#=DepartmentCode#")
.Columns(c =>
{
c.Bound(e => e.CesCode).Hidden();
c.Bound(e => e.CesName);
})
.ClientDetailTemplateId("ItemTmp")
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("GetCesData", "Cesce", new { depCode = "#=DepartmentCode#" }).Data("filterCes")).Model(m => m.Id(p => p.CesCode))
.Events(ev => ev.Error("onErrorCes"))
)
.ToClientTemplate()
)
</script>
<script id="ItemTmp" type="text/kendo-tmpl">
@(Html.Kendo().Grid<ItemObject>()
.Name("ItemGrid_#=CesCode#")
.Columns(columns =>
{
columns.Bound(p => p.Item).Hidden();
columns.Bound(p => p.Description).Encoded(false);
})
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("GetItemData", "Cesce", new { depCode = "#=DepartmentCode#", cesceCode = "#=CesCode#" }).Data("filterItem"))
.Events(ev => ev.Error("onErrorCes"))
)
.ToClientTemplate()
)
</script>
Can anyone understand what might cause this strange behavior?