FmxGrid column order question

I'm using Rad Studio Tokyo, C++ and Fmx UI pack 3.6.3.  After I drag a column, is there a way to make the displayed column order permanent so that Grid->ResetColumnOrder() will keep the displayed column order after dragging?  Just calling Grid->SetColumnOrder() doesn't change anything after dragging a column.   Would it be safe to swap grid->Columns->Items[0] and grid->Columns->Items[1] for instance and then call Grid->SetColumnOrder()?  I'm looking for a workaround to the issue of Grid->UnHideColumnsAll() also doing Grid->ResetColumnOrder().  If I can change Grid->SetColumnOrder() to keep the column order after dragging a column, it wouldn't matter.  Thanks for any advice.

SetColumnOrder() should define the new reference column order after calling it. I have retested this here and see no issues with this.

Test case on a default grid:


procedure TForm3.Button1Click(Sender: TObject);
begin
  TMSFMXGrid1.SetColumnOrder;
end;

procedure TForm3.Button2Click(Sender: TObject);
begin
  TMSFMXGrid1.ResetColumnOrder;
end;

procedure TForm3.FormCreate(Sender: TObject);
begin
  TMSFMXGrid1.LinearFill(False);
  TMSFMXGrid1.Options.Mouse.ColumnDragging := true;
end;

I drag columns to change the order to have columns 4,3,2,1.
Then call SetColumnOrder to set this as reference column order.
Then drag columns again to change column order to 1,2,3,4
When calling ResetColumnOrder, the grid column order reverts to 4,3,2,1

Thanks for the quick response, Bruno.  I'll check my code again.