RowChanged w/ DataRowState.Added still not working...

  • Thread starter Thread starter Mike Edenfield
  • Start date Start date
M

Mike Edenfield

I'm still having problems with the RowChanged event on the DataTable. I
need to find an event which runs after a new DataRow has been added to
the DataTable's Rows[] collection. Clearly, RowChanged() is not that
event, since the "e.Row" event argument is not in it's own DataTable's
Rows[] collection.

The following code demonstrates my problem:

private void RowChanged(object sender, DataRowChangeEventArgs e)
{
MyDataSet.MyRow row = e.Row as MyDataSet.MyRow;
DataRow[] rows = e.Row.Table.Select("ID = " + row.ID);
if ( rows.Length == 0 ) MessageBox.Show("Where's my new row?");
}

What am I missing?

--Mike
 
Hi:
Add this code after the form load
this.MyDataSet.Myrow.RowChanging +=new
DataRowChangeEventHandler(RowChanged);
 
Back
Top