Intercept cell value change in SfDataGrid

I have an application that when the datagrid is edited, it sends the row changed to a server. This is then propagated to all other clients to ensure that as users edit the datagrid, their changes are synchronised with eachother. I am currently using OnRowValidated to do this.

Rather than send the whole row, I want to just send the value changed according to the column. Is there a way to intercept an edit on the data grid where I will have the following information available:

  • The new value of the edited cell
  • The row item of the edited cell
  • The column of the edited cell

1 Reply

RM Rabina Murugan Syncfusion Team February 25, 2025 11:53 AM UTC

Hi Zia,

To get the New value  of the edited cell along with its corresponding Row data and column details, Kindly follow the below code snippet : 

sfDataGrid.CurrentCellValidating += SfDataGrid_CurrentCellValidating;
private void SfDataGrid_CurrentCellValidating(object sender, CurrentCellValidatingEventArgs e)
 {
     // To get the Old value
     var oldValue = e.OldValue;
 
     // To get the New value which is being edited
     var newValue = e.NewValue;
 
     // To get the Row Data
     var rowData = e.RowData;
 
     // To get the column data
     var column = e.Column;
 
 }  

Kindly refer to the attached sample for detailed implementation.

Regards,
Rabina


Attachment: SfDataGrid_1fb10ac6.zip

Loader.
Up arrow icon