I've bound the data grid (windows forms) to two related tables, at the
top Clients, and below the Jobs for that client. Most works well except
if one deletes all jobs for a given client, and then goes to add a new
one. The DataView.AddNew causes an index out of bounds exception. It
would appear from the stack that the grid is attempting to paint row #0,
which of course does not exist yet (not until I finish filling out the
DataRowView, and call drv.EndEdit).
I have tried suspending layout during the add, but no help.
I unbound and attempted to rebind after the add, which avoids the
exception, but once I rebind I am not able to see how to navigate back
to the newly created row in the child table. I end up at the job for the
first client. I don't see how to tell what row # to use to get to the
newly added job.
Banging my head on the wall until bloody. Googling until my fingers are
raw. I see others reporting problems such as this, but no one seems to
know the answer.
|