Skip to content

Ordering - DataList_

Holds the index of the main table to be used to display the database records of the main file

Type: Property
Access: Read/Write
Data Type: Integer
Parameters: None

Syntax

Property Integer Ordering
Access Type Syntax
Read Access: Get Ordering to IntegerVariable
Write Access: Set Ordering to IntegerVariable/Value

Description

The Ordering property stores the index of the main table (Main_File) to be used to display the database records of the main table.

If the Auto_Index_State property is set to True, popup lists will be activated automatically in the order of the main index of the column for the column the cursor is located in on activation.

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.

When Ordering is changed, the OnNewOrdering event is called.

Default is -1, which tells the runtime to choose the most-appropriate index based on current constraints.

Sample

This sample shows how to set the Ordering to index 4.

Set Ordering to 4

For some dbLists and dbGrids, particularly those that display data for child tables in relationships, you may have to ensure that the Ordering property of the Server Data Dictionary Object (DDO) is set to the same index as the Ordering of the list itself.

If the Ordering of the Server DDO cannot be set to a fixed index, you can set it conditionally. For example, you could change it during the Activating event of the dbList or dbGrid object:

Sample

This sample shows how to set the Ordering of the Server DDO to the same index as the Ordering of the list object.

Procedure Activating
    Forward Send Activating
    Set Ordering of (Server(Self)) to (Ordering(Self))    
End_Procedure

See Also

Auto_Index_State | ServerOrderingOverride