List boxes: Setup movable rows (or not!) by code

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.

HDI: Manage listbox properties

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

 

Roland Lannuzel
• Product Owner & 4D Expert •After studying electronics, Roland went into industrial IT as a developer and consultant, building solutions for customers with a variety of databases and technologies. In the late 80’s he fell in love with 4D and has used it in writing business applications that include accounting, billing and email systems.Eventually joining the company in 1997, Roland’s valuable contributions include designing specifications, testing tools, demos as well as training and speaking to the 4D community at many conferences. He continues to actively shape the future of 4D by defining new features and database development tools.