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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Grid hierarchical data structure (many-to-many)

Thread ID:





11188 Feb 26,2004 04:43 AM UTC Feb 29,2004 10:12 PM UTC WinForms 1
Tags: GridControl
Babu Mannaravalappil
Asked On February 26, 2004 04:43 AM UTC

Hi, 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. Babu

Administrator [Syncfusion]
Replied On February 29, 2004 10:12 PM UTC

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. ManyToManyHierarchicalGrid_7641.zip


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon