Grid - Show/Hide Grouped Header Row

 Grid grid = new Grid(container);
 grid.removeAllColumns();
 grid.setWidth(100, Unit.PERCENTAGE);
 layout.addComponent(grid);
 grid.addColumn("firstName");
 grid.addColumn("company");
 grid.addColumn("age");
 grid.addColumn("dummy1");
 grid.addColumn("dummy2");
 grid.setColumnOrder("company", "firstName", "age", "dummy1", "dummy2");

 Grid.HeaderRow groupingHeader = grid.prependHeaderRow();
 Grid.HeaderCell column1 = groupingHeader.join( groupingHeader.getCell("firstName"), groupingHeader.getCell("company"));
 column1.setText("first");

 Grid.HeaderCell column2 = groupingHeader.join( groupingHeader.getCell("age"), groupingHeader.getCell("dummy1"), groupingHeader.getCell("dummy2"));
 column2.setText("second");
 grid.setColumnReorderingAllowed(true);

 grid.getColumns().forEach( c -> c.setHidable(true));
 

i am trying to work with the Grid controls.
I am able to show/hide the individual columns by setting the setHideable() property of the Column , but i would like to show/hide the grouped columns .
I was trying to add the visibilitychange handler of grid controls but am unable to get the reference of the grouped header.
Is there a way to do it?


Moved this topic under the Framework UI category.