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

Passing field data from master to detail grid

1 Answer 971 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 13 Dec 2018, 11:33 PM

How do I pass field data from the master grid to the detail grid in the modal popup editor in kendo ui mvc? And how do I do the opposite?

 

Thanks,

James

1 Answer, 1 is accepted

Sort by
0
Alex Hajigeorgieva
Telerik team
answered on 18 Dec 2018, 04:01 PM
Hi, James,

Dependent on the desired outcome, there are different ways to achieve it. Also, it would be great to confirm if this is intended for a UI for ASP.NET MVC Grid or ASP.NET Core one?

One way to pass data from the master to the child grid would be to utilize the detailInit event that the Kendo UI Grid triggers when a child is expanded. The event comes with handly event data such as the master dataItem

https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/events/detailinit

When using a detail template, the dataItem is readily available with the Kendo UI Template syntax:

https://demos.telerik.com/aspnet-mvc/grid/detailtemplate

Another way would be by using the edit event which also has the master dataItem.

https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/events/edit

Finally, when it comes to passing data from the detail grid in an edit popup to the currently edited item, there are again different options. If you wish to trigger change, then you may use the set() method:

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

Let me know the exact requirements so I may assist you with specific suggestions.

Regards,
Alex Hajigeorgieva
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
DropDownList
Asked by
James
Top achievements
Rank 1
Answers by
Alex Hajigeorgieva
Telerik team
Share this question
or