The order in which columns are sorted.

Usage

Set_Property(OLECtrlEntID, "OLE.SortOrder", Array)

Values

Array has the following structure:

PosNameTypeDescriptionDefault
<0, 1>Column IndexIntegerIndex to a column to group by""
<0, 2>DirectionOptionSort directionA

Remarks

The SortOrder property establishes how rows are sorted. You can sort on any number of columns.

The SortOrder property is an @FM delimited list of column indexes and sort directions. The list is interpreted in order. So, if you specify only one column, then the rows are sorted only by that column. If you specify two columns, then the rows are sorted by the first column then by the second column. The same applies to three or more columns.

For each field, specify the column index and the sort direction, separated by @VM. The sort order can be "A" for ascending or "D" for descending. There is no notion of "L" or "R" because sorting is based on the column type.

To remove all sorting, simply set this property to an empty string "".

This property changes as the user clicks on column headers to change the sort order.

Example

// Sort by the first column, ascending 
Set_Property(@Window:".OLE_RECORDTABLE", "OLE.SortOrder", 1) 

// Remove all sorting 
Set_Property(@Window:".OLE_RECORDTABLE", "OLE.SortOrder", "") 

// Sort by the 3rd column (descending), then by the 2nd one (ascending) 
Set_Property(@Window:".OLE_RECORDTABLE", "OLE.SortOrder", 3:@VM:"D":@FM:2:@VM:"A")

See Also

ColumnListGroupOrderColumnSort

  • No labels