Problem with nested grid

3 posts, 0 answers
  1. Nick
    Nick avatar
    2 posts
    Member since:
    Oct 2017

    Posted 27 Oct 2017 Link to this post

    Hello!

    Could you help me please.

    I have a grid with detail rows. Inside each detail row there is a grid that has a detail rows too.

    But when I click inside external detail row, all master rows of internal grid are expanding! And next click collapsing all these rows. 

    Version of library - from 2014 year.

    I don't understand this behavior.

     

    Sorry for my bad English.

  2. Nick
    Nick avatar
    2 posts
    Member since:
    Oct 2017

    Posted 27 Oct 2017 in reply to Nick Link to this post

    My code:

    <script id="testerStepDetails_Template" type="text/x-kendo-template">
        <p>Some Text</p>
    </script>

    <script id="testerGrid_Template" type="text/x-kendo-template">
        @(Html.Kendo().Grid<SomeOtherView>()
                .Name("testerGrid_#=id#")
                .Columns(columns =>
                {
                    columns.Bound(p => p.created).Title("Дата-время").Filterable(false).Sortable(false).Format("{0:dd.MM.yyyy HH:mm:ss}");
                    columns.Bound(p => p.stepStatus).Title("Состояние").Filterable(false).Sortable(false);
                    columns.Bound(p => p.fromUser).Title("ФИО").Filterable(false).Sortable(false);
                })
                .ClientDetailTemplateId("testerStepDetails_Template")
                .DataSource(dataSource => dataSource
                    .Ajax()
                    .PageSize(100)
                    .Read(read => read.Action("SomeOtherMethod", "SomeOtherController", new { id = 123456}))
                )
                .Sortable()
                .ToClientTemplate())
    </script>

     

    @(Html.Kendo().Grid<SomeView>()
        .Name("testerGrid")
        .Columns(columns =>
        {
            columns.Bound(p => p.login)
                .Title("Логин").Filterable(true).Sortable(true);
           
            columns.Bound(p => p.name)
                .Title("Организация").HtmlAttributes(new { style = "max-width:140px" });

        })
        .Selectable()
        .Sortable()

        .ClientDetailTemplateId("testerGrid_Template")
        .DataSource(dataSource => dataSource
            .Ajax()
            .PageSize(10)
            .Batch(true)
            .Model(model =>
            {
                model.Id(p => p.id);
            })
            .Read(read => read.Action("SomeMethod", "SomeController", new { area = "SomeArea" }))

        )
        )

  3. Stefan
    Admin
    Stefan avatar
    2475 posts

    Posted 30 Oct 2017 Link to this post

    Hello, Nick,

    Thank you for the provided information.

    The described behavior is not expected unless there is a custom code which is expanding or collapsing the rows based on an event.

    I can suggest checking the following example with three-level-hierarchical Grid demonstrating the expected result and configuration:

    https://docs.telerik.com/aspnet-mvc/helpers/grid/how-to/editing/edit-three-level-hierarchical-grid

    If the issue still occurs, please use the provided example as a reference to demonstrate it or provide a new one and I will gladly assist.

    Regards,
    Stefan
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top