Home Forums WinForms controls Xceed Grid for WinForms Single grid displaying multiple Datatables Reply To: Single grid displaying multiple Datatables

User (Old forums)
Post count: 23064

You could try something like the following. The idea is to make the GridControl unbound, but use as many first level DetailGridTemplate as there are tables, and bind each detail grid to a specific table :


gridControl1.DataRowTemplate.Height = 0;

gridControl1.SynchronizeDetailGrids = false;

foreach( DataTable dataTable in dataTableToShowList )
DetailGrid detailGridTemplate = new DetailGrid();

detailGridTemplate.HeaderRows = new Xceed.Grid.ColumnManagerRow();

detailGridTemplate.SetDataBinding( dataTable, string.Empty );

gridControl1.DetailGridTemplates.Add( detailGridTemplate );



Xceed.Grid.DataRow row = gridControl1.DataRows.AddNew();


This will require some tweaking to make it look appropriate (no GroupByRow, etc…), but with this you should be able to get where you want.

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