Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
230
Data Relations
posted

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

Parents
No Data
Reply
  • 69832
    Suggested Answer
    Offline posted

    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.

Children