Log In    |    Knowledge Base    |    4D Home
Tech Tip: Sorting a column by clicking on its header
PRODUCT: 4D View | VERSION: 2003 | PLATFORM: Mac & Win
Published On: January 8, 2004

To be able to sort a single column in a 4D View you need to:
- install the pv On Clicked event
This is done by executing the following statement:
PV ON EVENT (area;pv on clicked;"HeaderSortMethod")

- place the following code in the method called by the pv On Clicked event:

 `HeaderSortMethod method

If ($5=0) `If the click takes place on a header
    $0:=True `Blocks the event
    PV SORT ONE (field3;$4;1;$4;25;1;$4;0) `Ascending sort of the selected column
End if