Home Forums WinForms controls Xceed Grid for WinForms hierarchical data binding to business objects in master/detail grid Reply To: hierarchical data binding to business objects in master/detail grid

User (Old forums)
Member
Post count: 23064

First, I didn’t notice one mistake you make in adding the second level DetailGrid.  You add it on the master grid, whereas you need to add it to the first level DetailGrid.

gridControl.DetailGridTemplates.Add( transactionGrid );

should be :

branchGrid.DetailGridTemplates.Add( transactionGrid );

 

Second, since you don’t have a relationship, you need to set the binding directly to the property name, in this case Transaction.

transactionGrid.SetDataBinding( null, “Branches.Transactions” );

should be :

transactionGrid.SetDataBinding( null, “Transactions” );

 

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