G
Guest
VS2003 C#
Hi,
I have a form with all txtboxes databound. A list box shows a list of names
which can be used to pick a record (using the find method to return the index
of the row. This index is then used to set the binding context position)
my problem is that when I add a row & accept changes to the table, the list
box (or more likely, the binding context object) seems to have its index
moved one up, so that picking a name now returns the *next* record. This
persists until the application is closed then started again.
Why is this happening? Am I missing out something? Here is how I save the
row...
newRow.contactMobile = frm.Mobile;
newRow.email = frm.Email;
// Add row to table
dsMain.contact.Rows.Add(newRow);
// persist data
daContact.Update(dsMain.contact);
// Accept changes made to the table
dsMain.contact.AcceptChanges();
Thanks greatly for any ideas
Ant
Hi,
I have a form with all txtboxes databound. A list box shows a list of names
which can be used to pick a record (using the find method to return the index
of the row. This index is then used to set the binding context position)
my problem is that when I add a row & accept changes to the table, the list
box (or more likely, the binding context object) seems to have its index
moved one up, so that picking a name now returns the *next* record. This
persists until the application is closed then started again.
Why is this happening? Am I missing out something? Here is how I save the
row...
newRow.contactMobile = frm.Mobile;
newRow.email = frm.Email;
// Add row to table
dsMain.contact.Rows.Add(newRow);
// persist data
daContact.Update(dsMain.contact);
// Accept changes made to the table
dsMain.contact.AcceptChanges();
Thanks greatly for any ideas
Ant