By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,949 Members | 946 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,949 IT Pros & Developers. It's quick & easy.

Master/Detail Issues

P: n/a
I have a DataSet that contains two tables (Orders and OrderDetails). These
two tables are linked with a relationship that supports cascaded updates and
deletes.

My form is laid out in a master/detail format with textboxes for the master
and a DataGridView for the detail. The DGV has it DataSource set to
DataSet.OrdersTable and the DataMember set to the name of the relationship
between the two tables. When a new Master item is created, the user is given
the various textboxes to fill in. Then the user tabs into the DataGridView.
Using the DataGridView_Enter event, I call
BindingContext.Item(DataSet.OrdersTable).EndCurren tEdit(). This forces the
row into the DataTable so that the child rows created by the DataGridView
will be able to relate back to the Primary Key in the Orders table.

This works very well until the user decides to go back to the TextBoxes and
change some of the data. When a change is made to the data that is bound to
the Orders table and then the user reenters the DGV, EndCurrentEdit() is
again called. This appears to refresh the data in the DataGridView. This
refresh is causing me the problem. I do not want the data in the DGV to be
refreshed as there is some information in there that is not bound to
anything. This refresh causes my unbound data to be lost. I would prefer to
not have to reload this information from the database every time a change of
this type is made.

Is there any way to suspend the DGV's bindings while I call EndCurrentEdit()
so that this does not happen?

Has anyone else run into this type of thing before, if so, what did you do
to get around it?
Jun 20 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.