We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

master-child-grandchild datagrids not working for me.

In the FAQ on this site, the procedures for building a triple layer relationship between grids is detailed. I''m building something that deperately needs this functionality, but I cant seem to make it work. First, the tables are the exact tables from the Northwind database. (Categories, Products, Suppliers) I''ve got these tables in a Dataset in memory, and I have added relationships as follows: MyDS.Relations.Add("ProductsToCategories",MyDS.Tables["Categories"].Columns["CategoryID"],MyDS.Tables["Products"].Columns["CategoryID"]); MyDS.Add("ProductsToSuppliers",MyDS.Tables["Suppliers"].Columns["SupplierID"],MyDS.Tables["Products"].Columns["SupplierID"]); Here is how I bind the grids: CategoryGrid.DataSource = gate.ShogunDataSet.Tables["ProductCategories"]; this.CategoryGrid.AllowNavigation=false; mf.SetProgressValue(80); MyDS.DataSource = MyDS.Tables["ProductCategories"]; this.ProductGrid.DataMember = "ProductsToCategories"; this.ProductGrid.AllowNavigation=false; mf.SetProgressValue(90); this.SuppliersGrid.DataSource = gate.ShogunDataSet.Tables["ProductCategories"]; this.SuppliersGrid.DataMember = "ProductsToCategories.ProductToSuppliers"; this.SuppliersGrid.AllowNavigation=false;

1 Reply

AK akilhoffer May 19, 2004 08:19 PM UTC

Sorry, I sent that last message before I could finish stripping out irrelevent code and replacing the object names ,shogundataset, with MyDS. Also, the table name "ProductCategories" is actually "Categories". Is that too confusing? I apologize for making it so complicating! Thanks in advance for any input!

Loader.
Up arrow icon