Home Forums WinForms controls Xceed Grid for WinForms Master Detail & Sub Detail Grid Reply To: Master Detail & Sub Detail Grid

User (Old forums)
Member
Post count: 23064

Basically, this is a problem in the way you set the DataSource and the DataMember properties.

The best way to go is to set the same DataSource to all the grids and set the DataMember to the relationship name of each level of detail grids.

e.g. :

gridControl1.BeginInit();

gridControl1.SetDataBindings( dataSet11, “Customers” );

DetailGrid dgrid1 = new DetailGrid();
DetailGrid dgrid2 = new DetailGrid();

gridControl1.DetailGridTemplates.Add( dgrid1 );
dgrid1.SetDataBindings( dataSet11, “Customers.Customers_Orders” );

dgrid1.DetailGridTemplates.Add( dgrid2 );
dgrid2.SetDataBindings( dataSet11, “Customers.Customers_Orders.Orders_OrderDetails” );

gridControl1.EndInit();

Imported from legacy forums. Posted by André (had 1708 views)