How to change the position of Columns in DataGrid by code?

How to change the position of Columns in DataGrid by code?

Hi,

  1. Obtain the column
  2. Remove it from DataGrid
  3. Add in the required possition
DataGrid.Column<User> column = dataGrid.getColumn("name");
dataGrid.removeColumn(column);
dataGrid.addColumn(column, 1);

Regards,
Gleb

Hi,

This doesn’t work if the column has custom rendering or has a header that is part of a merged set, using join().

It looks like these are cleared on the removeColumn() call, so is there a way to move a column and retain its renderer and the merge header relationships?

Thanks, Paul.