What is wrong with my code?
If I just bind the GetTable dataset gives me the right data. But If I add the relation with this empty table, gives me any empty table with only one column ("Column 0"). It should display my primary table with an option to expand (+).
Dim ds As DataSet = GetTable() If ds IsNot Nothing Then Dim dt As New DataTable("Temp") dt.Columns.Add("ID") ds.Tables.Add(dt) ds.Relations.Add(ds.Tables(0).Columns(0), ds.Tables("Temp").Columns(0)) End If Me.UltraGrid1.DataSource = ds
Try setting the DataMember property to the name of Tables(0). Incidentally, you can set the DataSource and DataMember in one atomic operation using the SetDataBinding method.
The problem actually with my code is I did not set the datatype of the new column which should match with the column in the first table.