OrderingItemNo property

Applies to
TIB_Dataset

Declaration
Property OrderingItemNo : integer;

Description
This property determins which of the OrderingItems entries is the current sort order of the dataset. If this property is changed and the dataset is Active then it will be refreshed using the new ordering selection.

If 0 is used then the ORDER BY clause as it appears in the SQL property of the dataset is used.

If it is less than zero then the descending criteria ot the referenced item by absolute value in the table is used.

If it is positive then the ascending criteria of the referenced item is used.

Please refer to the Contact sample application to see how this is implemented.

Here is some more hints for this stuff:

OrderingItems supports two ORDER BY criteria items per each line item entry. They should be separated with a semicolon. The first should be an ASCENDING criteria and the second (which is optional) should be based on the same columns but be DESCENDING.

OrderingItems:
Name=LASTNAME;LASTNAME DESC
ZIP=ZIP;ZIP DESC

OrderingLinks:
LASTNAME=1
ZIP=2

So, with the above items entered setting OrderingItemNo is valid for -2 to +2.

Here's a table of OrderingItemNo and the corresponding ORDER BY and
OrderingLink:

2 ORDER BY ZIP ZIP
1 ORDER BY LASTNAME LASTNAME
0 ORDER BY < whatever is in the SELECT statement > < blank >
-1 ORDER BY LASTNAME DESC LASTNAME
-2 ORDER BY ZIP DESC ZIP

The OrderingLink property tells the grid which column to put the arrow on. The sign of OrderingItemNo tells which way the arrow points. If there is an ASC and DESC criteria for the corresponding OrderingLink then the arrow has a dash above or below it to indicate that the column can be sorted both ways.