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

Batch Ajax update with many to many relationship

2 Answers 83 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Francis
Top achievements
Rank 1
Francis asked on 21 Jun 2017, 02:03 PM

I have a grid and I am doing ajax batch updates using the following methods in my controllers with Entity Framework. This is working fine.

http://docs.telerik.com/aspnet-mvc/helpers/grid/editing/batch-editing

Do you have a controller code example (hard to find on the net) to perform the same type of batch update but with a many-to-many db relationship as I have added a multiselect component on my grid?

This is a follow up of my post here

2 Answers, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 26 Jun 2017, 01:21 PM
Hello Francis,

In the Code Library linked in the other forum thread you will notice that the "Territories" field is IEnumerable<TerritoryViewModel> and that collection is passed to the Update action in the controller after an update operation. Note that it is up to the developer to save the changes. In the Code Library, the model is updated with the following line (HomeController.cs):
repository.UpdateEmployee(employee);


Regards,
Konstantin Dikov
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Francis
Top achievements
Rank 1
answered on 07 Jul 2017, 05:15 PM
Thank you. I found a similar pattern like here.
Tags
Grid
Asked by
Francis
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Francis
Top achievements
Rank 1
Share this question
or