DataGrid with Master-Detail DataSet

A

Alexey Maykov

I have a DataSet with two tables which are in a master-detail relationship.
How do I show a detail table in datagrid and some columns from a master
table. (Ex.: Orders and a customer name for every order comes from a
Customers table).
 
C

Chuck Rudolph

Alexey, First make sure that your dataset has the relationship defined. If
so, for the first datagrid, set the data souce to the dataset and the
datamember to the master table. For the second datagrid, set the data source
to the dataset. For the data memeber click the + on the master table in the
drop down and choose the linked table. There is an example in the msdn doc
on doing this but the key is having the relationship defined in the
dataset...Chuck
 
A

Alex

I have solved this problem by using virtual table (Views ) to select
necessary fields from two tables and then make the DataSource of datagrid
point to this virtual table , even I don't know if I have done correctly.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top