You can do it with this code in the header mouseup event:
LPARAMETERS nButton, nShift, nXCoord, nYCoord
select tablealias
if nbutton = 1 && left button
set order to indexname
else && right button
set order to indexname descending
endif
Saludos,
A.G.P.
---------