DataColumnChangeEventHandler how to get value before change?

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top