Home Forums WinForms controls Xceed Grid for WinForms Hierarchical representation of data Reply To: Hierarchical representation of data

Xceed Support
Post count: 5658

You cannot add a DetailGrid to only one DataRow. When adding a DetailGrid, you need to add it to all the DataRows.

To simulate this behavior, you could add an empty DetailGrid to all the DataRows and de-Synchronize the DetailGrids:

gridControl1.SynchronizeDetailGrids = false;
DetailGrid detail = new DetailGrid();
gridControl1.DetailGridTemplates.Add( detail );

And after, you can add specific content to each of the DetailGrids:

DataTable dt = new DataTable();
//Fill the DataTable
( ( Xceed.Grid.DataRow )gridControl1.CurrentRow ).DetailGrids[ 0 ].HeaderRows.Add( new ColumnManagerRow() );
( ( Xceed.Grid.DataRow )gridControl1.CurrentRow ).DetailGrids[ 0 ].DataSource = dt;

Imported from legacy forums. Posted by CharlesB (had 445 views)