Batch Editing in the Grid
How to edit several records in the grid at once and to only create one request to the database/service to save the changes? How to implement batch editing?
An example is available in the following project: https://github.com/telerik/blazor-ui/tree/master/grid/batch-editing
Clicking on the "Save All" button while there is an open cell editor can cause a race condition with the browser events. As a result, the new value in the open cell editor may not be persisted. There are two ways to avoid this:
- Use the
OnUpdateevents to enable the "Save All" button when the Grid is not in edit mode
- Check the Grid State in the "Save All" click handler to see if the Grid is in edit mode. In this case, call the OnUpdate handler manually and apply the user changes to the Grid data. Unlike the linked example, there is no need to exit edit mode programmatically, because the Grid will do that. However, mind the possibility for the
OnUpdatehandler to execute twice.