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

Hierarchical grids - child grids display data only when opened from bottom to top

1 Answer 223 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Matias
Top achievements
Rank 1
Matias asked on 20 Apr 2016, 06:21 PM

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.

1 Answer, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 25 Apr 2016, 06:10 AM
Hi Matias,

Please examine the following example that illustrates how you can implement hierarchical grid. Ensure that you have configured the Name for the child grid to be unique value.



Regards,
Viktor Tachev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Matias
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Share this question
or