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

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #15879 |

    I am wondering if anyone knows of a way to display multiple unrelated datatables in a single grid, basically having the datarows in each table grouped.

    Any way to do it?

    Thanks,
    Douglas

    Imported from legacy forums. Posted by Douglas (had 2019 views)

    User (Old forums)
    Member
    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 :

    <code>
    gridControl1.BeginInit();

    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 );
    }

    gridControl1.UpdateDetails();

    gridControl1.EndInit();

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

    </code>

    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)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.