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

Update parent row from change event in hierarchy grid

1 Answer 461 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Claimshark
Top achievements
Rank 1
Claimshark asked on 01 Oct 2020, 12:55 PM

Hi,

i have a scenario where when user edits one of the cell in hierarchical grid column value in parent row should get updated. Can you please help me with this?

1 Answer, 1 is accepted

Sort by
0
Tsvetomir
Telerik team
answered on 05 Oct 2020, 06:57 AM

Hi,

Since the Kendo UI Grid hierarchy has alternating detail and master rows, when the edit happens within the detail grid, access the parent row with the following jQuery selector:

$(element).closest("tr.k-detail-cell").prev("tr.k-master-row")

After accessing the master row in the parent grid, obtain the data item via the following method:

https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/methods/dataitem

The properties of the data item can be changed with the help of the set() method:

https://docs.telerik.com/kendo-ui/api/javascript/data/observableobject/methods/set

It would be helpful if you could share the whole scenario that you are willing to achieve so that I can provide more accurate suggestions.

 

Kind regards,
Tsvetomir
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Grid
Asked by
Claimshark
Top achievements
Rank 1
Answers by
Tsvetomir
Telerik team
Share this question
or