PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • Creating a Combo Box column
  • Characteristics of the Combo Box column
  • Limits in Java
  • Programming a Combo Box column
  • Initializing the content of the Combo Box column
  • Selecting an element of the Combo Box column by programming
  • Retrieving the content of a Combo Box column
  • Combo box with or without edit
  • Note
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Overview
A Table control (memory table, browsing table or table on data) can include Combo Box columns.
Combo Box columns can be used to view data file items (Combo Box, List Box, Radio Button or Check Box file items) in a Table control. Combo Box columns are also used to view images in a Table control.
Reminder: To display an image in a Table control, use an Image column.
For more details on Combo Box controls, see Combo Box control.
Creating a Combo Box column
To create a Combo Box column, simply select "Combo Box" in the column type:
Characteristics of the Combo Box column
In most cases, a Combo Box column in a Table control has all the characteristics of a Combo Box control. This Combo Box column can be linked to a data file, for example.
The following characteristics are available:
  • Editable or non-editable combo box ("Details" tab of the column description).
  • Combo box with or without assisted input ("Details" tab of the column description).
  • Sorted or unsorted combo box (for the memory combo boxes only, "Details" tab of the column description).
  • Configuring the button of the combo box ("Details" tab of the column description).
  • Configuring the drop-down list: width, height, resizable list ("Details" tab of the column description).
  • Displaying (or not) the selection bar in the combo box ("Details" tab of the column description).
  • Configuring the style of the combo box ("Style" tab, "Combo Box column (button)" element).
You can enter the initial value of the Combo Box column if it is not linked to a data file item.
Note: The height of a row in the Combo Box column is identical to the height of a row in the Table control.
Java

Limits in Java

The following characteristics are not supported in Java:
  • The spin of the combo box only visible on the current row.
  • The custom expanded height and width.
Programming a Combo Box column

Initializing the content of the Combo Box column

The content of the Combo Box column can be initialized:
  • in the editor, in the details of the column: in this case, it cannot be graphic.
  • by programming with ListAdd, in the initialization process of the Table control for example.
The content of the Combo Box column cannot be modified, even for an editable Combo Box. Therefore, the values proposed in a Combo Box column will be the same for all the rows of the Table control.

Selecting an element of the Combo Box column by programming

To select an element of the Combo Box column, simply specify its subscript in the Combo Box to display. This subscript can be used by the functions for managing the Table controls.
For example:
  • adding a row with TableAdd:
    // TABLE_CustomerTable contains:
    // - a combo box column that displays the title of the customers
    // (1 corresponds to "Mr", 2 to "Mrs" and 3 to "Miss")
    // - a string column that displays the name of the customers
    // Add "Mr" and "Doe" at the end of this Table control
    TableAdd(TABLE_CustomerTable, 1 + TAB + "Doe")
  • modifying the 5th row with TableModifyLine:
    // TABLE_CustomerTable contains:
    // - a combo box column that displays the title of the customers
    // (1 corresponds to "Mr", 2 to "Mrs" and 3 to "Miss")
    // - a string column that displays the name of the customers
    // Modify the 5th row with "Mrs" and "Thomas"
    TableModifyLine(TABLE_CustomerTable, 5, 2, "Thomas")

Retrieving the content of a Combo Box column

The value selected in a Combo Box column can be retrieved by ..Value.

Combo box with or without edit

  • Important:
    • In a non-editable combo box, the content of the combo box cannot be retrieved directly: only the subscript can be retrieved. To find out the value selected in the combo box, use ..DisplayedValue.
    • In an editable combo box, the content of the combo box can be retrieved directly.
  • The Combo Box column stores the corresponding subscript of the combo box (if an item is associated with the column, the subscript is also stored by the item). Therefore, the content of the combo box must not be modified.
  • The processes associated with a Combo Box column are identical to the processes associated with a Combo Box control.
  • The Combo Box columns in selection without input do not expand.

Note

The combo boxes in the Table controls have the same content for all the rows, only the selected value changes according to the row. However, since the version 14, you have the ability to change the content of the combo box columns for each row. To do so, use the ..Content property of the Combo Box column.
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment