I have two tables that I'm trying to display in a Master Detail fashion in an Infragistics UltraGrid. I added both tables to a dataset and added a datarelation between the two tables using the field that related both. When I run my application Ultra Grid just displays the master table, the child table is not displayed. Does anybody know what is wrong with my code? Grid expandable property is set to true, but is there any other property that I need to set to be able to see the chid table? Thanks for the help.
Expand|Select|Wrap|Line Numbers
- string sqlCommand = "";
- sqlCommand = "SELECT * FROM ENUM_VALUES";
- DataTable dt2 =
- DBBroker.getInstance().ExecuteSQL(sqlCommand);
- sqlCommand = "SELECT * FROM CONSTANTS";
- DataTable dt1 =
- DBBroker.getInstance().ExecuteSQL(sqlCommand);
- DataSet ds = new DataSet();
- ds.Tables.Add(dt1); //Add master table
- ds.Tables.Add(dt2); // Add child table
- DataRelation relConstEnum = new DataRelation("ConstEnum",
- ds.Tables[0].Columns["ID"],
- ds.Tables[1].Columns["CONST_ID"], false);
- ds.Relations.Add(relConstEnum);
- mGrid.Rows.ExpandAll(true);
- mGrid.DataSource = ds;