Changing sort column on AdvStringGrid

I am trying to change the column sorted programatically. When I click on a column at the top of the grid it sorts it and has little arrow glyph showing the direction. I want that glyph to move to the first column in my program when I reload the grid and I want that column to be sorted. I've tried all the SortSettings. Like StrGrd.SortSettings.Column := 0;. But it seems to have no effect when I reload the grid. It still sorts on the last column I had clicked on to sort, previously. I am using DXE8. 

grid.SortSettings.Column sets the column to sort on

grid.SortSettings.Direction sets the sort direction
These settings are applied when calling grid.QSort;

It doesn't seem to work for me. I do it after I have collected all the data. It stays sorted on the last column I clicked on for sorting. Is there any other porperties that have to be set? The only way I have been able to do it is destroy and create a new grid.

In my retesting, everything works as expected:


Grid is loaded with data on create, sorting can be done by click on column header. Clicking the button sets sort order on form column and this works as expected:

procedure TForm4.Button1Click(Sender: TObject);
begin
  advstringgrid1.SortSettings.Column := 1;
  AdvStringGrid1.SortSettings.Direction := sdAscending;
  AdvStringGrid1.QSort;
end;

procedure TForm4.FormCreate(Sender: TObject);
begin
  advstringgrid1.savefixedcells := false;
  advstringgrid1.loadfromcsv('c:\tmssoftware\cars.csv');
  advstringgrid1.SortSettings.Show := true;
end;

What about if you sort on a different column, by clicking on that column. Then set the sort in the program (SortSettings) back to column 1. Not clicking on the column, but doing it in the program?

That is exactly what I did in my tests and it works fine. I do in fact not see a reason why it wouldn't work.

I found the problem. It was saving the sort settings before the getting records and loading the grid settings after the records were loaded. So it was overriding my settings.

sTempSort := pnlfrmCallLogRpt.ASG.SortSettings.SaveToString;
pnlfrmCallLogRpt.ASG.SortSettings.LoadFromString( sTempSort );  {!!2.26}