Editing the child grid in a Parent/Child structured grids

2 posts, 0 answers
  1. Krobildo
    Krobildo avatar
    1 posts
    Member since:
    Oct 2016

    Posted 20 Oct Link to this post

    Hello there,

    I've a parent/child grid and I need to edit some columns in the child grids.

    When the page load the server send all the parent and children data needed to work in the client side, I mean, the user will be able to expand any child grid without the need of reading the data from the server when expanding a grid because the data is already in the client.

    I've attached a screenshot.

    Currently I've populated the child grids and I'm able to edit the rows but every time I edit one row in any child grid and the editor lose the focus the parent grid collapse all expanded children keeping the edited values.

    I've been working around that but I've no idea how to fix it and I've never used the Telerik controls.

    Here I attached a clean project reproducing the issue https://www.dropbox.com/s/9g76yrbccwh11r3/TelerikMvcApp1.7z?dl=0

    I really need to be able to edit the child grids without READING data from the server every time the user expand a child because the data in the child grid is built using heavy calculations and it takes a lot of time to finish.

    Can anyone help me fix the problem?

    Thank you.

  2. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1798 posts

    Posted 24 Oct Link to this post

    Hello Krobildo,

    Since you are binding the child Grids to a collection from the parent grid items, once you change a value from that collection, the entire parent Grid will be rendered again and I have to say that this could not be avoided, unless you use another instance of the data for the child grids and traverse the changes only when you need to save the data:
    function orderDetailInit(e) {
        var grid = $("#gridOrders_" + e.data.IdCustomer).data("kendoGrid");
        var data = JSON.parse(JSON.stringify(e.data.Orders));
        grid.dataSource.data(data);
    }

    With your current approach you can use the workaround for preserving the expanded state as suggested in the following forum thread:
    Hope this helps.


    Regards,
    Konstantin Dikov
    Telerik by Progress
    Check out the new UI for ASP.NET Core, the most complete UI suite for ASP.NET Core development on the market, with 60+ tried-and-tested widgets, based on Kendo UI.
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top