E
Erik Frey
Hi,
This is a half question/half gripe:
In the RowChanged event of a DataTable, if the event signals a row
addition (e.Action == DataRowAction.Add), why oh why is the DataRow added
only after the event has been fired? This is completely unintuitive, and
seems just plain wrong. It also allows for the following code:
private void DataTable_RowChanged(object sender, DataRowChangeEventArgs e)
{
if (e.Action == DataRowAction.Add) // evaluates true!
{
if (myDataTable.GetChanges() == null) // quite possibly evaluates true!
{
BecomeFrustrated();
QuitJob();
StartDeliveringPizza();
}
}
}
Erik
This is a half question/half gripe:
In the RowChanged event of a DataTable, if the event signals a row
addition (e.Action == DataRowAction.Add), why oh why is the DataRow added
only after the event has been fired? This is completely unintuitive, and
seems just plain wrong. It also allows for the following code:
private void DataTable_RowChanged(object sender, DataRowChangeEventArgs e)
{
if (e.Action == DataRowAction.Add) // evaluates true!
{
if (myDataTable.GetChanges() == null) // quite possibly evaluates true!
{
BecomeFrustrated();
QuitJob();
StartDeliveringPizza();
}
}
}
Erik