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

Getting an edited cell value

I have a grid that has been populated programmatically, but I am having trouble getting the value the user has entered in a cell. Using the CurrentCellAcceptedChanges event I can get the new value and the cell it was entered in, but only when the user presses enter, and only after the user has made one change already. If the user clicks on another cell before pressing enter I am not able to determine what was changed.

How do I determine what cell has been changed, and what it was changed to?

1 Reply

MN Muthulakshmi N Syncfusion Team August 13, 2010 09:56 AM UTC

Hi Chris,

Thank you for your details.
You can listen CurrentCell Changed event to achieve your requirement. This event will be raised only if current cell value is changed. Also to get the new value you can use the following code snippet:

this.dataGrid.CurrentCellChanged += new Syncfusion.Windows.ComponentModel.GridRoutedEventHandler(dataGrid_CurrentCellChanged);

void dataGrid_CurrentCellChanged(object sender, Syncfusion.Windows.ComponentModel.SyncfusionRoutedEventArgs args)
{
var renderer = this.dataGrid.Model.Grid.CurrentCell.Renderer;
var rindex = renderer.RowIndex;
MessageBox.Show("Modified Text "+ renderer.ControlText +
" Column Index "+cindex.ToString() +
" Row Index " +rindex.ToString());
}

Let us know if you need any details.

Regards,
Muthulakshmi

Loader.
Live Chat Icon For mobile
Up arrow icon