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
250
Bind WinGrid to a Hierarchical Data Source
posted

Greetings, The problem is basically the same as in the Help file only I need to make the dataSet programmatically. It works when the dataAdapter is amde with the designer, but not programmatically and I ahve seen this code (similar) shown repeatedly as the solution. Code:

 ds = new DataSet("CustOrders");
 ultraGrid1.DataSource = null;
 OleDbDataAdapter daCust = new OleDbDataAdapter("select * from customers", conn);
 OleDbDataAdapter daOrders = new OleDbDataAdapter("select * from orders", conn);
 daCust.Fill(ds, "Customers");
 daOrders.Fill(ds, "Orders");
 ds.Relations.Add("CustomerOrders",
    ds.Tables["Customers"].Columns["CustomerID"],
    ds.Tables["Orders"].Columns["CustomerID"]);
 ultraGrid1.DataSource = ds;
 ultraGrid1.DataBind();
I set the MaxBandDepth = 5 for performance. The ViewStyle is MultiBand. Both tables show in the data DataSet. The Grid just never displays the data. I get the same result when using the code directly from the sample page at WinGrid_Binding_to_Program_Generated_Hierarchical_Data.html that makes it's own tables.

Thanks much for the help, Mike

 

 

 

 

Parents Reply Children
No Data