OnCompare
Occurs while grid is being sorted by custom sorting routine.property OnCompare: TCompareEvent read FOnCompare write FOnCompare;
Example:
procedure TForm1.NextGrid1Compare(Sender: TObject; Cell1, Cell2: TCell;
var Compare: Integer);
begin
if (Cell1.AsString = 'bigger') and (Cell2.AsString = 'smaller')
then Compare := 1
else if (Cell1.AsString = 'smaller') and (Cell2.AsString = 'bigger')
then Compare := -1
else Compare := 0;
end;