Grouping and Sorting

Hello,

how can i grouping and sorting at the same time? My previous test are not successfully. Unique grouping or unique sorting are OK.
In col1 stands the grouping value, in col3 stands the sorting value.

I used the following code:
Grid.GroupColumn := 1;
Grid.SortSettings.Column := 3;
Grid.AutoSortForGrouping := True;
Grid.QSortGroup;

Best regards,
Marco.


I cannot see any problem here.

Using the code on a default grid:

begin
  advstringgrid1.RowCount := 15;
  advstringgrid1.RandomFill(false,4);
  advstringgrid1.GroupColumn := 1;
  advstringgrid1.SortSettings.Column := 3;
  advstringgrid1.SortSettings.AutoSortForGrouping := True;
  advstringgrid1.QSortGroup;
end;

shows correct sorting (per group) in column 3.

Hello Mr. Fierens,

thanks for your reply.

I have manually set the ColWidth of the grouping column to 0. This was the failure.

Best regards
Marco.