John,
You would need to create a dataset relationship between your master and
details tables. For example, a Customers/Orders relationship is created as
follows:
DataRelation dr = new DataRelation("C ustomerOrder",
ds.Tables["Customers"].Columns["CustID"],
ds.Tables["Orders"].Columns["CustID"]);
ds.Relations.Ad d(dr);
Next, for the customer/order example shown above, you would set up your
grids as follows:
productsGrid.Da taSource = ds;
productsGrid.Da taMember = ds["Customers"]
ordersGrid.Data Source = ds;
ordersGrid.Data Member = "Customers.Cust omerOrder";
By the way, if you have a master row, and you want to programatically get
the children, do the following:
DataRow [] rowsOrder = rowCustomer.Get ChildRows(ds.Re lations["CustomerOr der"])
-Mike
"John" wrote:
Hi
I am trying to create a master/detail form. I have my master and details
tables dragged onto the dataset. I have also dragged the fields from master
table on the form which has created the navigation toolbar for me and which
works fine with the master table. I also have a dataview on the same form
ready for detail table but as yet not assigned to the detail table. How can
I now create a master/detail relationship between my master and detail
tables such that the detail table shows up in the dataview control.?
Thanks
Regards