Skip to main content

SortColFmt$: Grid Column Sorting Format

Description

Grid column sorting format

This property is used to control the sorting of grid columns when a sort by date is required. Normally, when the grid sorts columns, it does so by either a numeric value comparison or a string compare. If the column contains a date, you need to tell the system the format of the date being provided so it can determine which value is the year, month or day respectively.

The SortColFmt$ property is used to control the sorting of date columns. This property can be set from one to three characters long where each character can be a '#', 'S', 'Y', 'M' or 'D', as follows:

  • If set to '#', the column will be sorted based on the assumption that all data in the column is numeric.

  • If set to 'S', the assumption is that all data in the column are strings and will be sorted based on string values.

  • If set to 'Y', 'M' or 'D', the letters will be used to indicate the order of the data in the column. (Lowercase 's', 'y', 'm' or 'd' is also supported.)

Example: If the date is of the form day, month, then year, the 'SortColFmt$ property should be set to "DMY".

If this field is not set, the column will be pre-scanned to determine if all values are numeric. If all the column data is numeric, then a numeric sort will be performed; otherwise, a string sort will be used.

The 'SortColFmt$ property works in conjunction with the 'Column or 'Colno property to identify the column to which the sort format will be applied.

(The SortColFmt$ property was added in PxPlus v7.10.)
(The ability to specify a format or "#" or "S" was added in PxPlus v11.)

Default

The default value is "" (no sorting definition).

Used By

GRID