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

2 posts, 0 answers
  1. Matias
    Matias  avatar
    26 posts
    Member since:
    Mar 2016

    Posted 20 Apr 2016 Link to this post

    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:
            .DataSource(dataSource => dataSource
                .Read(read => read.Action("Read", "controller")
            .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);

            .DataSource(dataSource => dataSource
                .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);

    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.

  2. Viktor Tachev
    Viktor Tachev avatar
    2212 posts

    Posted 25 Apr 2016 Link to this post

    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.

    Viktor Tachev
    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
Back to Top