I'm using a stored procedure to populate my dataset. It returns two tables. Table[0] is the master and Table[1] is the detail.
I've tried the following two examples. Any help would be apprecieated.
Example 1.
dataAdapter.Fill(myDataSet);
myDataSet.Tables[0].TableName = "workorder";
myDataSet.Tables[1].TableName = "details";
DataRelation dr = new DataRelation("workorders",
myDataSet.Tables[0].Columns["WorkOrderId"],
myDataSet.Tables[1].Columns["WorkOrderId"]);
DataSet.Relations.Add(dr);
radGridView1.AutoGenerateHierarchy = true;
radGridView1.DataSource = myDataSet;
radGridView1.DataMember = "workorder";
Example 2.
radGridView1.DataSource = myDataSet.Tables[0];
GridViewTemplate template = new GridViewTemplate();
template.DataSource = myDataSet.Tables[1];
radGridView1.MasterGridViewTemplate.ChildGridViewTemplates.Add(template);
GridViewRelation relation = new GridViewRelation(radGridView1.MasterGridViewTemplate);
relation.ChildTemplate = template;
relation.RelationName = "workorders";
relation.ParentColumnNames.Add("WorkOrderId");
relation.ChildColumnNames.Add("WorkOrderId");
radGridView1.Relations.Add(relation);