Skip to content

ColumnObjectsInDisplayOrder - cCJGrid

Returns an array of object handles representing the display order

Type: Function
Return Data Type: Handle[]

Syntax

Function ColumnObjectsInDisplayOrder Returns Handle[]

Call Example

Get ColumnObjectsInDisplayOrder to Handle[]Variable

Description

ColumnObjectsInDisplayOrder returns an array of object handles representing the current column display order. This array includes hidden columns, so you may need to check each column object's pbVisible property to determine the actual display order.

Handle[] hoCols
Integer iCol iCols
Boolean bVisible

Get ColumnObjectsInDisplayOrder to hoCols
Move (SizeOfArray(hoCols)) to iCols
For iCol from 0 to (iCols-1)
    Get psCaption of hoCols[iCol] to sLabel
    Get pbVisible of hoCols[iCol] to bVisible
    Showln (sLabel *  if(bVisible(""," - hidden")) 
Loop

Note that this order may not be the same as the column creation order because columns can be moved and hidden. The column creation order, which is the same order that the column data is stored in the datasource object does not change. If you wish to get the display order of columns, use ColumnCount and ColumnObject.

The cCJGridColumn property piColumnId returns an object's creation order.

Handle[] hoCols
Integer iCol iCols iId

Get ColumnObjectsInDisplayOrder to hoCols
Move (SizeOfArray(hoCols)) to iCols
For iCol from 0 to (iCols-1)
    Get psCaption of hoCols[iCol] to sLabel
    Get piColumnId of hoCols[iCol] to iId
    Showln (sLabel * "display=" +String(iCol) * "original="+String(iId)) 
Loop

See Also

ColumnCount | ColumnObject | SelectedColumn | SelectedColumnObject | piColumnId

Return Value

Returns an array of object handles representing the display order.