Binding a DataRelation to a Datagrid??

G

Guest

Hi,

I'm trying to bind a datarelation to a datagrid so that I'll show all the
columns from the first and second datatables that relate (parent/child).

The code below only shows the data from the master table? How do I include
the children? I'm having trouble find docs on this.

dst.Relations.Add("ArticleCompany", dst.Tables["Article"].Columns["CoId"],
dst.Tables["Company"].Columns["CoId"],false);

DataGrid1.DataSource = dst.Tables["Article"].DefaultView;
DataGrid1.DataMember = "ArticleCompany";
DataGrid1.DataBind();
 

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