Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
cellGroups not completely removed when removing column?
Hello,
I have a Grid which looks like this http://screencast.com/t/qMkZdSg5iOf, where I can add and delete columns dinamically.
When I select delete column 1, I want all columns below the header 1 to be removed. In order to do that I'm using this in a loop:
grid.removeColumn(propertyId);
But when removing columns I get the following exception, thrown by Grid.sanityCheck():
java.lang.IllegalStateException: Not all merged cells were in a continuous range.
When debugging my code I see that this
grid.getHeaderRow(0).getRowState().cellGroups.keySet()
returns [[2, 3, 4], [5, 6, 7, 8]] before removing any columns, then, inside my loop, keys 5 and 6 are removed, but 7 and 8 are not. As I result I get the above exception..
I don't understand why some of the keys are being removed and others aren't.. Actually if I debug deeper, in the Grid.internalRemoveColumn(), inside this remove method:
getState().columnOrder.remove(columnKeys.key(propertyId));
it seems that the keys do get removed..!
Any help is much appreciated.
Thalia