Example of Sorting a Firemonkey StringGrid
===

My basic attempt at sorting a Firemonkey Stringgrid, as couldn't find any other examples.  I would welcome any optimisations or other suggestions on best achieving this.  My code basically gets the column chosen to sort and with that sort order completes for other columns:

    procedure TfrmMain.StringGridSort(StrGrid: TStringGrid; SortColumn: Integer);
    var
      MySortCol, MyListCols: TStringList;
      col, row, rowx: Integer;
    begin
      MySortCol := TStringList.Create;
      MyListCols := TStringList.Create;
      MySortCol.Sort;
      MyListCols.Sorted := False;
      for row := 0 to StrGrid.RowCount - 1 do
        MySortCol.AddObject(StrGrid.Cells[SortColumn, row], TObject(row));
      MySortCol.Sorted := True;
      for row := 0 to StrGrid.RowCount - 1 do
        StrGrid.Cells[SortColumn, row] := MySortCol[row];
    
      for col := 0 to StrGrid.ColumnCount - 1 do
        If col <> SortColumn then
        begin
          MyListCols.Clear;
          for row := 0 to StrGrid.RowCount - 1 do
            MyListCols.Add(StrGrid.Cells[col, row]);
    
          for rowx := 0 to StrGrid.RowCount - 1 do
            StrGrid.Cells[col, rowx] :=
              MyListCols[Integer(MySortCol.Objects[rowx])];
        end;
      MySortCol.Free;
      MyListCols.Free;
    end;

Thanks in advance Paul