When clicking sort buttons, it does not seem to adjust the direction setting in SortSettings. I think you need something like........
procedure TTIWRGSortSettings.SetColumn(const Value: Integer); begin {ML!!} if FColumn = Value then begin if FDirection = sdAscending then FDirection := sdDescending else FDirection := sdAscending; end; { to here } FColumn := Value; end;
Sorry - I am using a TTIWDBAdvWebGrid and using the title buttons with the AsyncSort property. This procedure has not been over-ridden in the DBAdvWebGrid object. Perhaps it needs something like the non DB grid??
In the TTIWDBAdvWebGrid is not done automatically, you can use the ColumnHeaderClick event to programmatically change the sort order of your dataset. In this case swapping the SortSettings.Direction property is also left to the responsibility of the programmer to decide if it needs to be changed or not.
As noted above, when using the TTIWDBAdvWebGrid sorting will not be done automatically but should be added programmatically using the ColumnHeaderClick event.