Sets a value that sorts selected rows according to selected criteria. This property is not available at design time.
Syntax
object.Sort [=value]
The Sort property syntax has these parts:
Part | Description |
object | An object expression that evaluates to an object in the Applies To list. |
value | An integer or constant that specifies the type of sorting, as described in Settings. |
Settings
The settings for value are:
Constant | Value | Description |
flexSortNone | 0 | None. No sorting is performed. |
flexSortGenericAscending | 1 | Generic Ascending. An ascending sort, which estimates whether text is string or number, is performed. |
flexSortGenericDescending | 2 | Generic Descending. A descending sort, which estimates whether text is string or number, is performed. |
flexSortNumericAscending | 3 | Numeric Ascending. An ascending sort, which converts strings to numbers, is performed. |
flexSortNumericDescending | 4 | Numeric Descending. A descending sort, which converts strings to numbers, is performed. |
flexSortStringNoCaseAsending | 5 | String Ascending. An ascending sort using case-insensitive string comparison is performed. |
flexSortNoCaseDescending | 6 | String Descending. A descending sort using case-insensitive string comparison is performed. |
flexSortStringAscending | 7 | String Ascending. An ascending sort using case-sensitive string comparison is performed. |
flexSortStringDescending | 8 | String Descending. A descending sort using case-sensitive string comparison is performed. |
flexSortCustom | 9 | Custom. This uses the Compare event to compare rows. |
Remarks
The Sort property always sorts entire rows. To specify the range to be sorted, set the Row and RowSel properties. If Row and RowSel are the same, the ModHFGrid will sort all non-fixed rows.
The keys used for sorting are determined by the Col and ColSel properties. Sorting is always done from left to right. For example, if Col =3 and ColSel =1, the sort is done according to the contents of columns 1, then 2, and then 3.
The method used to compare the rows is determined by the value, as explained in Settings. The 9 (Custom) setting is the most flexible but is slower than the other settings, typically by a factor of 10. An alternative to using this setting is to create an invisible column, fill it with the keys, and then perform a sort based on Custom using another setting. This is a good approach for sorts that are based on dates.