Caused by: java.lang.UnsupportedOperationException
at java.base/java.util.Collections$UnmodifiableList.add(Collections.java:1352)
``` and is caused by lines
My objective is to move the last column to the first column. I see ``setColumnOrder`` method is available to reorder the columns but it needs individual columns. I do not want to create the columns manually and later add it to ``setColumnOrder``. Please let me know how can I reorder the columns?

In the docs, under Components > Grid > Column Reordering & Resizing, the code shows:
grid.setColumnReorderingAllowed(true);
I figure if it allows DnD functions like this, then it should be allowable/possible to do it programmatically too. Unfortunately, the code example doesn’t show this.
You can’t modify the result of getColumns, the list is unmodifiable. You can use this list and create a copy in the order you want then call setColumnOrder
I created a copy like this ```final List<Grid.Column> columnList = grid.getColumns();
columnList.remove(columnList.size() - 1);
columnList.add(0, rowIndex);
grid.setColumnOrder(columnList);```. But still getting the same exception. What am I doing wrong ?
I think is what you meant ```final List<Grid.Column> columnList = new ArrayList<>();
columnList.addAll(grid.getColumns());
columnList.remove(columnList.size() - 1);
columnList.add(0, rowIndex);
grid.setColumnOrder(columnList);```. This one worked