4D v16.3

LISTBOX MOVE COLUMN

Home

 
4D v16.3
LISTBOX MOVE COLUMN

LISTBOX MOVE COLUMN 


 

LISTBOX MOVE COLUMN ( {* ;} object ; colPosition ) 
Parameter Type   Description
Operator in If specified, object is an object name (string) If omitted, object is a variable
object  Form object in Object name (if * is specified) or
Variable (if * is omitted) of the column to be moved
colPosition  Longint in New location of column

The LISTBOX MOVE COLUMN command moves the column designated by the object and * parameters by programming in the context of the form being executed (Application mode). The original form, generated in the Design mode, is not modified.

The object and * parameters designate the column to move. Passing the optional * parameter indicates that the object parameter is a column name (string). If you do not pass this parameter, this indicates that the object parameter is a column variable. In this case, you pass a variable reference instead of a string. 

The column is moved to just in front of the one designated by the colPosition parameter. If the colPosition parameter is greater than the total number of columns, then the column is moved to just after the last column.

Note: This command does nothing when it is applied to the first column of a list box displayed in hierarchical mode.

The command takes the static and locked column properties into account: for example, if you try to move a static column, the command does nothing.

This functionality was already found in 4D in Application mode: the user can move non-static columns using the mouse. However, unlike columns moved by the user, this command does not generate the On Column Moved event.

Example  

You want to swap the 2nd and 3rd columns of the list box:

 LISTBOX MOVE COLUMN(*;"column2";3)



See also 

LISTBOX DUPLICATE COLUMN

 
PROPERTIES 

Product: 4D
Theme: List Box
Number: 1274

 
HISTORY 

Created: 4D v14

 
ARTICLE USAGE

4D Language Reference ( 4D v16)
4D Language Reference ( 4D v16.1)
4D Language Reference ( 4D v16.2)
4D Language Reference ( 4D v16.3)