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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

is there a specific cell event ( CellEditEnd Event(?) ) in Grid control?

Thread ID:





132535 Sep 7,2017 05:16 AM UTC Sep 8,2017 05:44 AM UTC ASP.NET MVC 1
Tags: Grid
Dongil Shin
Asked On September 7, 2017 05:16 AM UTC

Hi I'm testing on Syncfusion mvc editable grid.

Each row has birthdate and age cells.

Once I enter the birth date value, I then tab across to the Age cell.
I want the Age cell value to be calculated automatically.
Is there an event I can use that allows me to fire it so that when I move the cursor to the Age field, the age value is calculated based on the birth date?

Please give me some idea.

Thank you in advance!
Kind Regards

Seeni Sakthi Kumar Seeni Raj [Syncfusion]
Replied On September 8, 2017 05:44 AM UTC

Hi Dongil, 
Thanks for contacting Syncfusion Support.  
We can update the other cell values while updating the current cell value in the batch editing mode using the CellSave event and setCellValue method. Refer to the following code example and API References.  
           .EditSettings(edit => 
                     . .  
                     . . . 
                 . .  
        .ClientSideEvents(events => events.CellSave("onCellSave")) 
        .Columns(col => 
                col.Field("EmployeeID").IsPrimaryKey(true).HeaderText("Employee ID").Add(); 
                . . .  
                      . ..  
                col.Field("BirthDate").HeaderText("Birth Date").Format("{0:MM/dd/yyyy}").Add(); 
<script type="text/javascript"> 
    function onCellSave(args) { 
        if (args.columnName == "BirthDate") { 
            var age = calculateAge(args.value); 
            var inx = this.getIndexByRow($(args.cell).closest("tr")); 
            this.setCellValue(inx, "Age", age); 
    function calculateAge(birthDate) { 
        birthDate = new Date(birthDate); 
        otherDate = new Date(); 
        var years = (otherDate.getFullYear() - birthDate.getFullYear()); 
        if (otherDate.getMonth() < birthDate.getMonth() || 
            otherDate.getMonth() == birthDate.getMonth() && otherDate.getDate() < birthDate.getDate()) { 
        return years; 
We have prepared a sample that can be downloaded from the following location.  
For calculating the Age from the given date, please follow this article.  
Seeni Sakthi Kumar S. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

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

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