This should be simple

  • Thread starter Thread starter Karl
  • Start date Start date
K

Karl

Hi All

I have followed the MSDN example for setting up a master/child windows form,
using textboxes and a datagrid. The textboxes display values from a single
record (the master) and the datagrid shows the related records.

For calrity I'm using two dataadpaters one dataset and I have a relation
object, theough a currencymanager

All works well if I want to update or add child records to the grid as long
as it's to an existing master. However if I add a new master and go to the
grid the related field value for the master does not appear for the child
record. How can I make it so that the related child receives the value from
the master whether or not it's been saved back to the database.

Any help would be appreciated


Cheers
 
Are you calling AddNew on ALL CurrencyManagers...not just the one for your
master, but the one for your child too.
 
Greg

Thanks for your reply, there is only one currencymanager in this scenario,
I have found a temporary solution which is to
Greg said:
Are you calling AddNew on ALL CurrencyManagers...not just the one for your
master, but the one for your child to refresh the currencymamager on
entering the datagrid
i.e

Private Sub dgDatagrid_Enter(ByVal sender As Object, ByVal e As
System.EventArgs) Handles dgAircraftDetails.Enter

cm.EndCurrentEdit()

cmAircraft.Refresh()

End Sub

I don't know how inelegant or inefficient this is but it works for my
purpose, so now when i click in the datagrid the foreignkey is filled.

Cheers


Karl Edwards
 
Back
Top