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
close icon

Where is the CellValueChanged Event Handler for SfDataGrid?

Hi, 

Where is the CellValueChanged Event Handler for SfDataGrid?

What I want to achieve is to update certain columns of that specific row in an Access database after a change has been made directly in the SfDataGrid. 

I will need to update the [Last Modified Date] of the row if [Name] is changed when directly making a change on the SfDataGrid.

I do not want to update [Last Modified Date] if nothing is changed. That's why I can't use CurrentCellEndEdit.

Any workarounds for this? Thank you so much in advance!

2 Replies

SU sulthan January 16, 2020 08:05 AM UTC

Even me having the same issues.. no cellvaluechanged event



AR Amal Raj U Syncfusion Team January 17, 2020 09:04 AM UTC

Hi Hanson & Sulthan, 

Thanks for using Syncfusion products. 

SfDataGrid doesn’t has CellValueChanged event, instead it supports View.RecordPropertyChanged event that notifies the value changes in a record. 

The value of the specific column can be updated when the value of another column is modified using the ItemPropertiesProvider in View.RecordPropertyChanged event. Please make use of the below example. 

Code example: 
// Wires RecordPropertyChanged event to update "Last Modified Date" 
this.sfDataGrid1.View.RecordPropertyChanged += OnRecordPropertyChanged; 
 
private void OnRecordPropertyChanged(object sender, PropertyChangedEventArgs e) 
{ 
    if (e.PropertyName == "Name") 
    { 
        // Updates the "Last Modified Date" 
        this.sfDataGrid1.View.GetPropertyAccessProvider().SetValue(sender as DataRowView, "Last Modified Date", DateTime.Now); 
    } 
} 
 
 
Regards, 
Amal Raj Umapathy Selvam. 


Loader.
Live Chat Icon For mobile
Up arrow icon