I have an AdvancedDataGrid with many columns, some of them
grouped together so that I have multiple levels of column headers.
As it turns out, I
need to combine two column headers into one that spans two
columns and each of these columns has currently an itemRenderer
assigned (one is a subclass of Label and one is a subclass of
The problem is that if you just group the columns and give
the ColumnGroup a headerText and leave the headerText for the
individual columns blank, you will get an extra level of empty
headers => not pretty at all.
I would like that empty header level to disappear...
My first thought was to create a new custom renderer that
would be comprised of my custom Label and custom Image classes but
I don't seem to be able to figure out how to access the datafields
to populate my cells...
my second thought was to see if I could combine the two
headers for the two columns into one and not deal with datafields.
Seems the simpler approach to me but I am stuck there too...
I think combining to headers is not possible with the current
design, so the second approach may not work.
I can suggest 2 approaches but both of them have some
One approach is to use a custom item renderer extending HBox
and use it as itemRenderer for a column for which the header should
be spanning other columns. It will give the header spanning kind of
looks but the drawback here is that you can't get the resize
fuctionality within that column.
Second approach is to use the rendererProviders and make the
first row as your headers and remove the default headers i.e
lockedRowCount = 1;
and write a custom renderer which implements IDataRenderer
and use r.data which is an AdvancedDataGridColumn to get the
headerText of that column and use it in your renderer.
Now, set rendererProviders for the first row.
The drawback here is that, you can not sort the data.