Hide Collapsed Column Group Headers

Posted by: nemanja on 23 October 2020, 1:30 am EST

  • Posted 23 October 2020, 1:30 am EST - Updated 3 October 2022, 6:20 am EST

    Hi,

    I am trying to create a grid which uses both column and row-level grouping, to display data.

    I can build up the grouping on the row level using the tree grid format and setting the childItemsPath binding on the flex grid, and dynamically generate columns within column groups, depending on the hierarchy that we need to use.

    It works well, except that a mutli-level column group hierarchy because rather large and takes up far too much of the screen.

    One of the things I’d like to be able to do is to change the styling of the column header rows so that only the ones that are expanded are visible, so that any collapsed ones don’t take up screen space unnecessarily.

    The other option would be for the child columns to slide to the right of the parent in a flat hierarchy structure, rather than necessarily going onto a new row. I’m not sure whether that second option is possible?

    I’ve attached what it currently looks like to this ticket, so I’d love to be able to reduce the size of those column headers somehow.

    Thanks,

    Nemanja

  • Posted 27 October 2020, 5:16 am EST

    Hi Nemanja,

    Could you please let us know how exactly you need the columns to be hidden? If I understand correctly what you need is if 1st row of columns is not expanded then 2nd and 3rd rows should remain hidden too? Is it correct?

    Also, if your data is summary data, then you may also consider using pivotgrid control:

    https://www.grapecity.com/wijmo/demos/OLAP/PivotGrid/OutlineMode/purejs

    Regards

    Sharad

  • Posted 27 October 2020, 6:41 pm EST

    Hi Sharad,

    Thanks for the reply - I believe it was you who replied to my other post on the PivotGrid, which sort of explains why we can’t use that approach. As you can see in the screenshot above, we have a list of measures which we need to display along the vertical axis (at times) and the Pivot Grid doesn’t seem to allow for that currently.

    In terms of what we need to do with the columns, the ideal scenario would be as follows:

    [ - All Time ] [ - Y1 ] [ - Y1_S1] [ - Q1 ] [ + Y2 ] [ + Y3 ]

    So basically it would be great if we could have a collapse / expand functionality on the ‘parent’ column, which would toggle the visibility of all underlying columns. So you can only show the portion of time you want to see rather than having them all expanded. If they are lined up on a single row, it simplifies the whole thing greatly.

    I suppose it’s like having the column grouping as it currently works, but as a flat structure?

    Thanks,

    Nemanja

  • Posted 29 October 2020, 8:40 pm EST

    Hi Nemanja,

    I think I understand your requirements. You need to display all the 5 column headers rows into a single row and the expand/collapse operation should be performed on the same row.

    If this is your requirements, then we are sorry but this is not possible. The hierarchical columns can only be displayed in multiple rows.

    Regards,

    Ashwin

  • Posted 29 October 2020, 9:04 pm EST

    Thanks Ashwin, that is exactly what I was trying to do.

    It is possible though - I’ve managed to implement it, though I had to write templates for the column headers and implement the collapse / expand functionality myself.

    It was simply a case of identifying which columns should collapse / expand and having the relationships between them at hand to toggle visibility. But it seems to work well enough.

    Thanks anyway.

    Nemanja

  • Posted 29 October 2020, 9:04 pm EST

    Thanks Ashwin, that is exactly what I was trying to do.

    It is possible though - I’ve managed to implement it, though I had to write templates for the column headers and implement the collapse / expand functionality myself.

    It was simply a case of identifying which columns should collapse / expand and having the relationships between them at hand to toggle visibility. But it seems to work well enough.

    Thanks anyway.

    Nemanja

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels