DataTable RowChanged how to get previous Row value?
.net, c#, datatable, events
Solution
You should subscribe to the `ColumnChanged` event, that way you can see the previous and current values.
Example:
//code to wire up the handler
custTable.ColumnChanged += new DataColumnChangeEventHandler(Column_Changed);
//code for the event
private static void Column_Changed(object sender, DataColumnChangeEventArgs e )
{
Console.WriteLine("Column_Changed Event: name={0}; Column={1}; original name={2}",
e.Row["name"], e.Column.ColumnName, e.Row["name", DataRowVersion.Original]);
}
Problem
I have a DataTable. When change in row happens I need to get this row and it's previous value(DataRow). How can I get it?