There's something strange going on with a hierarchical grid: the parent grid displays the data correctly, but when trying to display the data of the child grids, they only display everything when opening them from the last row to the first one.
These are my grids:
PARENT GRID:
@(Html.Kendo().Grid(Model)
.Name("ParentGrid")
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("Read", "controller")
.Data("ParameterFunction"))
.PageSize(30)
)
.Columns(columns =>
{
columns.Bound(foo => foo.fecha_venc).Title(Global.Fecha).Format("{0:dd/MM/yyyy}"); //This is the date I need formatted
columns.Bound(foo => foo.espe_codigo).Title(Global.Especie);
columns.Bound(foo => foo.clas_codigo).Title(Global.Clase);
})
.ClientDetailTemplateId("template")
)
CHILD GRID:
@(Html.Kendo().Grid<SGMTrade.DAL.ViewModels.OperacionesOCTPorFecha>()
.Name("ChildGrid")
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(10)
.Read(read => read.Action("childGrid_Read", "controller", new { fecha = "#=fecha_venc#", especie = "#=espe_codigo#", cliente = @ViewBag.cliente, clase = "#=clas_codigo#" }))
)
.Columns(columns =>
{
columns.Bound(o => o.oper_numero).Title(Global.NumeroOperacion)
.ClientTemplate("<a href='\\\\\\#' onclick=\"showDetails('\\#=oper_numero\\#')\">\\#=oper_numero\\#</a>");
columns.Bound(o => o.oper_forigen).Title(Global.FechaOrigen).Format("{0:dd/MM/yyyy}");
columns.Bound(o => o.espe_codigo).Title(Global.Especie);
columns.Bound(o => o.clas_codigo).Title(Global.Clase);
})
.ToClientTemplate()
)
As it can be seen in the first attachment, if I display the second child grid first and then the first grid, I'm able to display every data, but if I go for the first child grid, the data from the second child grid is not displayed.
I analysed the code and I get the data from the stored procedure just fine, but I can't see it in the view.
Thank you very much.