Grid for Blazor - How to post changes to an in-memory data source
When a user starts editing a row, our Blazor Grid (DxGrid) creates an edit model - a copy of the processed data item. This model stores all changes while the original data item remains intact. You need to update the data source to save changes. This example uses the AutoMapper library to update all field values of an in-memory data record.
The EditModelSaving event fires when a user completes row edits and allows you to save changes. Use the event argument's EditModel property to access the edit model. The DataItem property allows you to access the proccessed data item as requirements dictate.
Install the AutoMapper library and call its Map
method to assign all edit model field values to corresponding data item fields simultaneously.