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

Editing the child grid in a Parent/Child structured grids

1 Answer 207 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Krobildo
Top achievements
Rank 1
Krobildo asked on 20 Oct 2016, 04:41 PM

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.

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 24 Oct 2016, 11:39 AM
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.
Tags
Grid
Asked by
Krobildo
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or