List boxes are powerful form objects. They’re easily created and manipulated, and most importantly, they can handle any kind of data. Additionally, they can be fully set up by programming … everything from inserting or deleting rows and columns, to defining or modifying tons of properties using the 4D language. With 4D v18 R4, another important property has been added to the list. Can you guess which one? Hint: read the title again.
In the case of array-based list boxes, it’s possible to define (in Design mode) if end users can move rows (e.g., to reorder, group rows, etc.)
This property was not previously modifiable by programming. The LISTBOX SET PROPERTY command could set over twenty different properties, but “lk movable rows” wasn’t on the list… until now!
In order to designate rows as movable (or not), just use:
LISTBOX SET PROPERTY(*;"myListbox"; lk movable rows ; True / False)
And if you need to know if rows belonging to a list box are movable or not, just use the same constant within the function:
$isMovable:=LISTBOX Get property(*;"myListbox";lk movable rows)
That’s it! Enjoy setting your list boxes as you wish!
More information is available in the doc center.