List Property - ComboBox control

Gets or sets the collection of list items to display in the drop down list of a combo box control.

object.List(index) as [string]

Where object is an object expression that evaluates to one of the controls in the Applies To list, and string can be either a literal string array, an SQL query or an expression, depending on how this property is being set.

Client support

   Newlook Smartclient

   Newlook Server

How is a combo box list derived?

A combo box's drop down list is generated from the control's underlying list array at runtime. This array is derived in the following way (see sub-sections below this list for more detail):

It's important to note that the value in the List property at design-time may not be the same as the drop down's physical list at runtime.

Identified field choice values

When a combo box is automatically generated from a host field, the control's underlying list array is populated with an array of values that have been recognized as valid field choice values (or field choice values and field choice description pairs) for the field. This array becomes the default List property.

In the examples below, the host entry field is followed by a series of characters that the recognition engine has recognized as valid field choice values for this field. These values will automatically become the default list items for the generated combo box. The List property will be populated with a semi-colon delimited string array containing the four recognized field choice values.

  g

List Property = ;I;A;R

 

In the case of inserted combo box controls, the default list array is empty and must be set, at either design-time or run-time.

Setting the List property

If the combo box control is generated from a host field, then the List property will default to an array of identified field choice values, however it is possible to override this default array by replacing the List property with a different literal string array, SQL query or an expression that evaluations to a literal string array. It is also possible to append items to the default list by using an append expression (see example below).

TIP!

If you have modified the List property of an host-generated combo box and you want to get the default list back, position your cursor in the List property and click the default () button.

If the combo box is an inserted control, then the List property can be set either at design-time or at run-time.

The contents of the Text property

If the control's Text value is not one of the items in the list array, it will be added to the array. This is particularly relevant for host generated fields where any value that is sent through from the host will be automatically added to the control's list array, even if it has not been identified as a valid field choice value by the recognition engine.

BE AWARE THAT:

If you have manually overridden the Text property in Designer, then the overridden value will display in the text portion of the control and added to the list array rather than any value sent through from the host.

BE AWARE THAT:

If a control is bound to a data source via the DataField and DataSource properties then any value specified in the Text property at Design-time will be ignored.

Dynamically modifying the list at run-time

At run-time, individual items in the list array can be accessed via their index and the total count (of items in the array) is available via the ListCount property. It is possible to modify the final list array at run-time via a script or macro.

See Also

ItemData property | ListCount property | ListIndex property | NewIndex property | Sorted property | ListIndex property | ShowDropDownListValues property

Applies To

Combo box control


© 2004-2021 looksoftware. All rights reserved.