On changing cell value which event will give me old and new value of cell

While changing the cell value which event will give me the old and new(changed) value of the cell. I need to do some comparision of old value and changed value .

Please help

Thanks

1 Reply

AD Administrator Syncfusion Team January 31, 2007 03:49 AM UTC

Hi,

The Renderer.ControlText returns the active cell’s display text and the grid[row, col].Text will return the text/value of a particular cell that is stored internally in the GridData object.

Please try this code snippet in any one of the events like CurrentCellValidating, CurrentCellChanged, or CurrentCellValidated.

GridCurrentCell cc =this.grid.CurrentCell;
string oldvalue=string.Empty;
string newvalue=string.Empty;
oldvalue = this.grid[cc.RowIndex, cc.ColIndex].Text;
newvalue = cc.Renderer.ControlText;
Console.WriteLine(("OldValue=" + oldvalue));
Console.WriteLine(("NewValue=" + newvalue));


Thanks for choosing and using Syncfusion Products.

Best Regards,
Jeba.

Loader.
Up arrow icon