DataColumnChangeEventHandler how to get value before change?

  • Thread starter Thread starter PeterZ
  • Start date Start date
P

PeterZ

Hi,

I have a datagrid bound to a dataset. I'm detecting when a single column
value has changed in the datagrid using the DataColumnChangeEventHandler.

Can anyone tell me how I could obtain the value BEFORE it was changed? The
DataColumnChangeEventArgs doesn't seem to hold this information, but it must
reside somewhere because if you call RejectChanges() on the dataset it
reverts back all changes.


I create the custom event like this:
------------------------------------
myDataSet.myTable.ColumnChanged += new
System.Data.DataColumnChangeEventHandler(myTable_ColumnChanged);


The handler:
-------------
private void myTable_ColumnChanged(object sender, DataColumnChangeEventArgs
e)
{
// Show the column name that's been changed
MessageBox.Show(e.Column.ToString());

// Show the new value that has been entered
MessageBox.Show(e.ProposedValue.ToString());

// Show the value prior to change:
// ..... how do I get that ? .......
}


Thanks,
PeterZ
 
Back
Top