TDBAdvGrid Expandable columns

Hi,

I've been searching for a while how to make columns expandable in a TDBAdvGrid, without any success.

We've been using another component that allowed us to have a result like this :

I tried with MergeCells, Headers, etc...facing several issues (e.g. header row always goes on top if you're having several FixedRows).

Is it possible to have approximately the same result with TDBAdvGrid ?

Thanks.

For this, it looks like you would need to set grid.FixedRows = 3 and then perform a merge on every first 6 cells for 3 rows. Then a horizontal merge for the cell in column 6 etc...

What exactly is going wrong for you?

Hi,

Thank you for your reply.
First issue encountered : no way to expand / collapse columns like we did with this other component.

Here is another example we cannot replicate to illustrate the second issue :

When playing with fixed rows / MergeCells, the headers automatically move to row pos 0 at runtime. And we did not find any way to control headers positions among fixed rows.

Setting FixedRows := 2 :

To achieve that, we would need the first 5 headers in fixed row 0, then cols 5 to 11 / 12 to 18 in fixed row 1. But we did not find how to control headers position.

Let's ignore the first 5 columns.
Merging cells of row 0:
dbgrdVFL.SaveFixedCells := False;
dbgrdVFL.MergeCells(5, 0, 7, 1);
dbgrdVFL.MergeCells(12, 0, 7, 1);

At runtime :


Headers on row 1 move automatically to row 0.
Tried several things (SaveFixedCells := True for example) without success.

Is there a way to control Headers of TDBAdvGrid ? Specifically where they go among fixed rows.
Or any other parameters we could have missed ?

I suggest to fill the header cells programmatically at application level after the dataset was activated.
You can set the header cells yourself using:

grid.Cells[col,row]: string;

Note that for setting the text value of a merged cell, you'd set the text for the topleft coordinate of the merged cell.

Thanks for the reply.

We have too many grids with too many columns in our projects to do this programmatically for each grid.
We'll go back to our previous component as collapsable columns / headers managment are key features missing in TDBAdvGrid.

Regards.