We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to update Summary with unsaved Changes in Batch Edit Mode

During batch editing, the summary row will be updated once the update action is completed successfully.

So upon changing any value in batch edit mode, doesn’t alter the corresponding summary row value.

Solution:

We can achieve the above requirement using the CellSave event of the grid.

The CellSave event will be triggered every time a cell value is being altered.

Example:

In the following example, we have rendered a grid with batch editing and summaryRow enabled.

  1. Render the grid

JS:

 

MVC

 

ASP:

 

  1. In the CellSave event of the Grid, using the args parameter the difference in the value updated is calculated and accordingly the sum of the column is calculated and updated. The formatting for the calculated value is done using the formatting method of the Grid.

 

 

Result:

Fig 1: Initial Rendering

 

Fig 2: On editing a cell

Fig 3: On saving the edited cell

Article ID: Published Date: Last Revised Date: Platform: Control:
6315 02/15/2016 02/15/2016 ASP.NET Web Forms Grid
Tags:
Did you find this information helpful?
Comments
Jani Arovaara Apr 27, 2016
It would be useful if there was a simple option to do live summary updates for add/remove/edit without having to write any custom code.
Reply
Jani Arovaara Apr 27, 2016
Also, with grouping enabled, this script updates the first group's summary no matter where the edit took place...
Reply
Add Comment
You must log in to leave a comment

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.