New to Telerik UI for ASP.NET Core? Download free 30-day trial
Batch editing OData-v4
- EXAMPLE
- VIEW SOURCE
- Edit in Theme Builder
-
Change Theme
DefaultSASSLESS
- Default
- Bootstrap
- Material
- Launch Theme Builder
- odatav4.cshtml
- OdataV4Controller.cs
- ProductViewODataModel.cs
Also available for:
API REFERENCEDescription
A common scenario is to switch grid cells in edit mode by simply clicking on them, update the data on the client and then process all changes on the server in a single batch update.
This demo shows how this can be accomplished using the built-in batch create, update and destroy commands of the Telerik for ASP.NET Core Grid.
To enable the batch data editing functionality:
- Turn on the in-cell editing by setting:
.Editable(editable => editable.Mode(GridEditMode.InCell))
- Add the Create, Cancel and SaveChanges buttons to the toolbar by setting:
.ToolBar(toolbar => { toolbar.Create(); toolbar.Save(); }
- To enable the Delete command on each row insert a new column:
columns.Command(command => { command.Destroy(); });
- Set
.Batch(true)
and.ServerOperation(false)
properties in the DataSource declaration to enable batch updates and perform the paging, sorting, filtering and grouping operations on the client. - Declare the Create, Read, Update and Destroy action methods in the DataSource. These methods are responsible for the data items manipulation.
- Specify a unique field in the Model as the DataSource Model Id
Once the cells are edited you have the option to process the changes or discard them. Click on a cell to place it in edit mode. Use the Save changes or Cancel changes buttons to process/discard all changes at once.
Check out the Kendo UI oData-v4 Service Repository
More about theTelerik Grid for ASP.NET Core