BlankHi,
I have been unable to find info on the recommended way of editing and then
ending the edit for an application that uses databinding, including how a
field - currency manager - dataview - datatable ALL work together when
modified directly by a user or by code. I'm running into a problem with
various edits causing the application to get confused (me too) on what's
currently in an edit state and therefore on what to call the EndEdit. I've
seen conflicting advice to use/not use the CurrencyManager.EndCurrentEdit
method so I've been staying away from that.
Example: A form has fields bound to a DataSet.DataTable and to a DataView.
Of course the user can directly edit a field. Does this implicitly cause a
BeginEdit to occur? If yes on which object (i.e. the currencyManager,
dataview, or datatable)? Then elsewhere in the code, processing occurs and
the code modifies values. If BeginEdit isn't explicitly called, is it
automatically implicitly called when a value is changed in any of the
objects I've mentioned? As the application has grown I now see that values
are modified in different places - in a field, currencyManager, dataView or
dataTable. I'm assuming I need to pick one place to modify the values and
stick with it, but for which object is it best to do this? Should Begin/End
Edit be called within each sub that modifies data?
Also, how do you work with and what's the difference for a DataTable's
DataRowView that exists in a DataView and the current row of a
CurrencyManager?
Summary of possible EndEdits that I'm concerned with (where x is a row
number):
CurrencyManager.EndCurrentEdit
CType(CurrencyManager.Current, DataRowView).EndEdit
DataView(x).EndEdit
DataSet.DataTable(x).EndEdit
Appreciate any insight and understanding you may have to share...
Thanks,
NJ
|