L
Larry Woods
I have a Parent-Child situation (defined in one dataset, with a relation
defined); let's say Customers-Orders. I can display Cust-Orders just fine
in two datagrids. I have an "Update" button that checks for changes in the
dataset and if so then updates the dataset. Since I have a lot of fields in
the Child table, I only display a few of the fields in the Child datagrid,
and display ALL of the Child fields in a set of textboxes that are bound to
the Child table through the Parent-Child relation. Again, all displays
fine. If I click on a row of the Child datagrid, all of the approriate
fields are displayed in the textboxes. Then I change a field value in one
of the textboxes. The changed field value appears in the Child datagrid, as
expected. BUT, when I click the Update button, when I check for dataset
changes there AREN'T ANY! IOW, the "changes" dataset is Nothing. I can go
back and make the SAME change directly into the Child datagrid and then
there ARE dataset changes defined in the "Update" procedure.
First, any ideas on what's happening? But, more importantly, how do I get
my textbox changes to be reflected as dataset changes in my Update
procedure?
TIA,
Larry Woods
Here is a code snippet of what I am doing in the Update procedure:
Dim objDataSetChanges As myDataset = New myDataset
'Stop any current edits.
Me.BindingContext(myDataset , "tblParent").EndCurrentEdit()
Me.BindingContext(myDataset , "tblChild").EndCurrentEdit()
'Get the changes that have been made to the main dataset.
objDataSetChanges = CType(myDataset.GetChanges, myDataset)
'Check to see if any changes have been made.
If (Not (objDataSetChanges) Is Nothing) Then
..........
defined); let's say Customers-Orders. I can display Cust-Orders just fine
in two datagrids. I have an "Update" button that checks for changes in the
dataset and if so then updates the dataset. Since I have a lot of fields in
the Child table, I only display a few of the fields in the Child datagrid,
and display ALL of the Child fields in a set of textboxes that are bound to
the Child table through the Parent-Child relation. Again, all displays
fine. If I click on a row of the Child datagrid, all of the approriate
fields are displayed in the textboxes. Then I change a field value in one
of the textboxes. The changed field value appears in the Child datagrid, as
expected. BUT, when I click the Update button, when I check for dataset
changes there AREN'T ANY! IOW, the "changes" dataset is Nothing. I can go
back and make the SAME change directly into the Child datagrid and then
there ARE dataset changes defined in the "Update" procedure.
First, any ideas on what's happening? But, more importantly, how do I get
my textbox changes to be reflected as dataset changes in my Update
procedure?
TIA,
Larry Woods
Here is a code snippet of what I am doing in the Update procedure:
Dim objDataSetChanges As myDataset = New myDataset
'Stop any current edits.
Me.BindingContext(myDataset , "tblParent").EndCurrentEdit()
Me.BindingContext(myDataset , "tblChild").EndCurrentEdit()
'Get the changes that have been made to the main dataset.
objDataSetChanges = CType(myDataset.GetChanges, myDataset)
'Check to see if any changes have been made.
If (Not (objDataSetChanges) Is Nothing) Then
..........