G
Guest
In Chap 13 David shows you how to bind a second form to the same data source
by passing the CurrencyManager as an arg to the EditDetail Method of the
second form:
Public Sub EditDetail(byval CM as CurrencyManager)
drvDetail = Ctype(CM.Current, DataRowView)
vueDetail = drvDetail.DataView
Me.BindingContext(vueDetail).Position = CM.Position
I have run into a problem that I am really stumped on - if the CM passed in
has no Current position, which would be the case if you were possibly adding
the first row to a child table, then you can not get at the DataView.
Is there some other way to get to the DataView?
This is also a problem I am faced with when I have a DataView of a parent
table and use the following code to bind children where the DataMember is a
relationship:
With grdGuestContacts
.DataSource = oParentsView
.DataMember = "tblGueststblGuestContacts"
CM = CType(Me.BindingContext(.DataSource, .DataMember), CurrencyManager)
end with
If the child table has no records there is no way (that I know of) to get at
the DataView in order to disable AllowNew because CM.Current is NOT on a
current record.
Any ideas?
by passing the CurrencyManager as an arg to the EditDetail Method of the
second form:
Public Sub EditDetail(byval CM as CurrencyManager)
drvDetail = Ctype(CM.Current, DataRowView)
vueDetail = drvDetail.DataView
Me.BindingContext(vueDetail).Position = CM.Position
I have run into a problem that I am really stumped on - if the CM passed in
has no Current position, which would be the case if you were possibly adding
the first row to a child table, then you can not get at the DataView.
Is there some other way to get to the DataView?
This is also a problem I am faced with when I have a DataView of a parent
table and use the following code to bind children where the DataMember is a
relationship:
With grdGuestContacts
.DataSource = oParentsView
.DataMember = "tblGueststblGuestContacts"
CM = CType(Me.BindingContext(.DataSource, .DataMember), CurrencyManager)
end with
If the child table has no records there is no way (that I know of) to get at
the DataView in order to disable AllowNew because CM.Current is NOT on a
current record.
Any ideas?