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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GGC Remember old cell value

Thread ID:

Created:

Updated:

Platform:

Replies:

73484 May 8,2008 10:04 AM UTC May 9,2008 02:20 PM UTC Windows Forms 1
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On May 8, 2008 10:04 AM UTC

Hi

Is their a built in function to know or even remember the value of a cell in the grid?
I would also need to know if there is something like row state filter or a way to know if a cell value has changed

Thanks
Francois


Administrator [Syncfusion]
Replied On May 9, 2008 02:20 PM UTC

Hi Francois,

Thanks for the interest in Syncfusion products.

You can remember the value of the cell in a grid when the cell is validating. You can use CurrentCellValidated event to know if a cell value has changed. Please refer the following code snippet that shows how we can achieve this behavior.


private void gridControl1_CurrentCellValidated(object sender, EventArgs e)
{
GridCurrentCell cc = this.gridControl1.CurrentCell;
string newValue = cc.Renderer.ControlText;
string oldValue = this.gridControl1[cc.RowIndex, cc.ColIndex].Text;
if (oldValue != newValue)
{
if(MessageBox.Show("[Value Changed to]: " +newValue + " [OldVaue ]: "+ oldValue+" \n\nWant to Save ?" ,"Validating Cells" , MessageBoxButtons.YesNo,MessageBoxIcon.Warning) ==DialogResult.Yes)
{
this.gridControl1.EndUpdate();
}
else
{
cc.RejectChanges();
this.gridControl1[cc.RowIndex, cc.ColIndex].Text = oldValue;
this.gridControl1.EndUpdate();
}
}
}


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

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

Please let me know if this is not what you needed.

Regards,
Asem.



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;