WebGrid 7 also supports scenario that submits all updates in a single AJAX request via built-in WebGrid user interface, or via API.
In this topic, you will learn how to accept all changes from client side event.
To accept all changes
- Creating Updatable Hierarchical WebGrid in Batch Update mode (Using ISDataSource).
- Open the page in VS Design view and add an HTML button.
- Double click the button in order to add OnClick client side event of the button.
<input id="Button1" type="button" value="Accept All Changes" onclick="return Button1_onclick()" />
- On OnClick event of the button, write the following function:
C# Copy Code function Button1_onclick() { var grid = ISGetObject("WebGrid1"); grid.AcceptAllChanges(); return true; }
- View the page in browser, make any changes to the grid, and click the button to accept all changes.