From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Table control with a list-box inserted

Is it possible to have a table control with the cells being a drop down list box?

Example you click on the first cell and you get a list of options to choose from.

You click on the second cell you get a different list of options ot choose?

 

0 Kudos
Message 1 of 5
(3,567 Views)

I don't think you can do this with a built-in table control.  I think what you can do is have a separate list box that appears over top of your table cell when you click on it.  Then when you've picked your item, the program will change the cell value with the item you picked from the list box.  You'll have to use the Event structure to handle all of these user clicks.

 

Search the forums.  I'm sure this has been asked before so there should be some examples for it.

0 Kudos
Message 2 of 5
(3,552 Views)

Instead of using the Table Control, I use a 1-D array (stretched out vertically), where each element of the array is a cluster containing a set of controls arranged horizontally. The controls can be enums. Generally it is a good idea to make the cluster a strict type-def, as well as the individual controls within the cluster. You can enable the vertical scrollbar on the 1-D array so that you can scroll up and down just like a regular table. Also, a neat trick is to use an event structure to enable/disable specific enum elements based on settings in other "columns".

0 Kudos
Message 3 of 5
(3,522 Views)

A 1-D array of clusters is a good idea also.

 


@Chris_12345 wrote:

 Also, a neat trick is to use an event structure to enable/disable specific enum elements based on settings in other "columns".


You need to be carefule with this.  While elements of an array can have different values, the items within it cannot have different properties.  So you can not have an enabled control in cluster at element 2 of the array, but have that same control be disabled in element 5 of the array.

0 Kudos
Message 4 of 5
(3,515 Views)
Agreed about the need to be careful with the enum properties. Code was written so that when an enum was clicked on, an event structure immediately enabled/disabled the various items in an enum based on the value in another column, then upon mouse release all items in the enum are enabled. This was done to make sure the user couldn't select invalid items in the enum (whether an item was valid or not being dependent on the value in the other column).
0 Kudos
Message 5 of 5
(3,480 Views)