I have a Database and a corresponding dataset with a few tables. Some of
the tables have many-to-many relations established by a link table. For
example, a vendor supplies merchandise to many stores and a store purchases
from many vendors. So, I have Vendors Table, I have Stores Table and I also
have a StoresToVendors link table. StoresToVendors table stores the primary
keys from the other two tables as foreign keys in two columns.
Now, how can I create a Grid with two levels of hierarchical rows, one for the
Store (Parent) and another for Vendors (Children), or vice versa, without
showing the link table in the picture at all? What is the best and easiest
way to do this? Can somebody point me to any sample C# code, if any? Any
help is appreciated. Thanks.
ADAdministrator Syncfusion Team February 29, 2004 05:12 PM
One way you can approach this is to define a relation between your CompanyTable (parent table) and your CompanyToVendorsTable (child table). But in the child table, instead of showing the records from the child table, use unbound columns to show records from the VendorsTable. This requires handling model.QueryCellInfo to populate the unbound columns directly from the VendorsTable.
Here is a little sample.