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

GridControl Cell Changing

Which event in a GridControl would give me the old and new value when user changes the text in a cell.

Thanks


1 Reply

AD Administrator Syncfusion Team April 19, 2008 07:27 AM UTC


Hi Raj,

Thanks for the interest in Syncfusion products.

You can use CurrentCellChanged event to get the old value as well as the new value of your grid cell. Please refer the code snippet that shows how we can get the old value and new value of the grid.


private void gridControl1_CurrentCellChanged(object sender, EventArgs e)
{
GridCurrentCell cc = this.gridControl1.CurrentCell;
string oldvalue = string.Empty;
string newvalue = string.Empty;
oldvalue = this.gridControl1[cc.RowIndex, cc.ColIndex].Text;
newvalue = cc.Renderer.ControlText;
Console.WriteLine(("OldValue=" + oldvalue));
Console.WriteLine(("NewValue=" + newvalue));
}


Please refer the sample in the below link that illustrates the above.

http://websamples.syncfusion.com/samples/Grid.Windows/F73045/main.htm


Please let me know if you have any questions.

Regards,
Asem.



Loader.
Live Chat Icon For mobile
Up arrow icon