Ordering - cDbCJGrid

Determines index of the DD Server's main table to be used to display the database records. This determines order of the grid upon activation.

Type: Property

Access: Read/Write

Data Type: Integer

Parameters: None

Syntax
 Property Integer Ordering

Read Access: Get Ordering to IntegerVariable
Write Access: Set Ordering to IntegerVariable/Value


Description

The Ordering property determines the initial index of the Server's main table to be used to display the database records.

Ordering is usually set at design time and it determines the that will be used upon grid activation. Once a grid is activated, changing Ordering will not change the grid order. If you need to change the order of an active grid use the ChangeOrdering method. You may also change the grid order with the ReorderGridByColumn and HeaderReorder methods.

During activation, the grid is bound to its datasource. At this time, the datasource object's cDbCJDataSource.piGridOrdering property is set to Ordering. This will be used as your grid order unless your grid's data dictionary sets an explicit value for its Server property. If the DataDictionary Object (DDO) sets an explicit property (i.e., The DDO's Ordering is not -1), the ordering specified by the DDO will be used.

Use an index number that is available in your table definition. If you set it to a value higher than the maximum number of indexes for the current table, you will be notified at runtime via an "invalid index" error. If you specify a non-existent index number, you will receive an "invalid index" error or a "column not indexed" error.

A value of 0 (zero) indicates that the record number (RECNUM) index should be used.

The default for Ordering is -1, which tells the runtime to choose the most-appropriate index based on current constraints. It is best to set an explicit ordering.

The pbReverseOrdering property can be used to determine the order direction upon activation.