Hi all,
I have a dataset that contain 2 tables and a relationship between them
(master detail).
I bind this dataset to a form that include some textboxes that bind to the
parent record, and a datagrid that is binded to the detailed records.
Here is the code:
Code:
Private Sub FillHeader(ByRef dsDataSet As DataSet)
Try
txtKey.DataBindings.Add(New Binding("text", dsDataSet , "header.key"))
txtNo.DataBindings.Add(New Binding("text", dsDataSet , "header.no"))
Catch ex As Exception
HandleExceptions(ex)
End Try
End Sub
Code:
Private Sub FillLines(ByRef dsDataSet As DataSet)
Try
dsDataSet.Tables("lines").Columns("key").ColumnMapping =
MappingType.Hidden
dsDataSet.Tables("lines").Columns("product_id").ColumnName = "Product
Id"
dsDataSet.Tables("lines").Columns("quantity").ColumnName = "Quantity"
dgLines.SetDataBinding(dsDataSet.Tables!lines, "HeaderLines")
Catch ex As Exception
HandleExceptions(ex)
End Try
End Sub
The sub I use to navigate is (For example I put only the next command):
Code:
Sub cmdNext() Implements ICommandNext.cmdNext
Try
bdRecordNavigator = BindingContext(dsHeader, "header")
bdRecordNavigator.Position += 1
Catch ex As Exception
HandleExceptions(ex)
End Try
End Sub
My problem happens when I navigate between the master records. The textboxes
show the correct values, but there is no change in the datagrid. What do I
miss here, that this sub will handle the datagrid as well?
Thanks