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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to sum all the values in a column and display it in an external input box in the BatchEditing?

Platform: ASP.NET MVC |
Control: Grid |
Published Date: February 10, 2015 |
Last Revised Date: August 6, 2015

In certain cases, while dynamic editing you may want to sum all the values in a column and display it in an input text box.


You can achieve the above requirement by using create and cellSave events or an external button click event with the Sum summary type.

The create event is triggered when the Grid has rendered completely. In the argument of the create event, you can obtain the following details.




Returns the cancel option value


Returns the Grid model


Returns the name of the event


The cellSave event is triggered when a cell is edited and saved on batchEdit mode. In the argument of the cellSave event, you can obtain the following details.




Returns the Grid model


Returns the name of the event


Returns the deleted data


Returns the column name


Returns the row data object


Returns the modified cell value


Returns the previous value of the cell


Returns the columnObject


Returns the cell object


Returns when the edited column is ForeignKey


The Sum Summary type yields the sum of the data. The parameters of the ej.sum are listed in the following table




Json data where the sum operation is to be performed

Column/Field Name

Corresponding field name for calculating the sum



In the following example, the Grid is rendered with batch editing enabled.

  1. Render the Grid.





  1. Render the input control for displaying the sum calculated.


  1. In the create event, the sum of all the values in the Freight column is obtained by using ej.Sum summary type and displayed in the input text box.
  1. In the cellSave event, when the cell value is edited and saved, the edited value is obtained. The difference of the edited value compared to the default value of the cell is added to the original sum.


Figure 1: Initial Rendering

Note: The sum of the Freight column is calculated and displayed in the input text box.

Figure 2: After Editing and saving a cell

2X faster development

The ultimate ASP.NET MVC UI toolkit to boost your development speed.
You must log in to leave a comment
Steve Davey
Oct 12, 2015
Every example you show with foreign keys is badly done. NO ONE would EVER display key fields in a grid - they are useless. Your ASP.NET MVC project template is the same. Your controls may be good, but your documentation is poor Reply

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon 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.Close Icon

Live Chat Icon For mobile