Rows.Add and CurrencyManager

  • Thread starter Thread starter Christopher Weaver
  • Start date Start date
C

Christopher Weaver

When I add a row to my DataTable my CurrencyManager doesn't know it's there.
I have a ComboBox and a CurrencyManager bound to a DataTable such that a
selection within the ComboBox causes all controls bound to that DataTable to
display the appropriate row. Fine. But when I do this:

dsTaskActivities.Tables["Tasks"].Rows.Add(NewTaskRow);

the CurrencyManager seems to ignore the new record. it shows up in the
ComboBox and I can DataTable.Rows.Find it, but nothing causes the
CurrencyManager to synch the rest of the controls to the selected row.

Any ideas on this?
 
Christopher,

Are you expecting all of the controls selection to go to the new row?
If so, then that is incorrect. You would have to set the Position property
of the manager to the index of the new row, and then all the other controls
will synch themselves to that row.

If the controls are lists which are bound to the data in that list, then
make sure you are not bound to a view which could not filter out the new
row.

Hope this helps.
 
Back
Top