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: 

Data Container with comboboxes with differentes values inside

Hi!

 

I have been trying to do a part of the project I am working on for two weeks. This part consist on the following. 

 

My program reads an excel and save the measurements it contains into many arrays, until that it works. But, I need to include these arrays into comboboxes, rings or whatever allow me to choose a value of these arrays inside a data container. 

 

I can't use an array because as you know, comboboxes in arrays always have the sames values and I can't use a cluster because depending on the excel you read there are more or less measures and can't add elements to a cluster dinamically.

 

I add an screenshot of the frontend I would like to get. I know I can't do it like that but it is just to represent the ideal work of what I need.

 

THANK YOU!

0 Kudos
Message 1 of 10
(2,479 Views)

Hi Kanayel,

 

in an array all elements share the same properties: so your rings have to have the same items.

In a cluster each element can have different properties, so this would be one way to go.

 

In a cluster the number of elements is fixed: as you need a variable amount of elements you would have to "fake" it by adding an additional selector so the user can switch between several "sets" of rings. Would work, but doesn't provide a nice UI and UX.

 

My suggestion: show the list of options in a (multicolumn) listbox. Here the user can select the item (s)he want to change. For each selected item you can provide an inputs next to the listbox.

Similar to this:

check.png

Listbox on the left, controls (on the right side) to change the entries…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 10
(2,465 Views)

If you can guess what's the maximum number of arrays, you can actually use a Cluster containing the maximum number of Combo Boxes.

Define the Cluster AutoSize property as anything else than None and hide/show the proper number of Combo Boxes, via the Cluster Controls[]  property. The Cluster area will be resized properly.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 3 of 10
(2,457 Views)

An example of what I suggested.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 4 of 10
(2,408 Views)

In addition to other described techniques, one can also use "filter" events such as "Mouse Down?" to set the elements in a combo box or ring, based on which array element is clicked on.  This can simulate an array of combo boxes with different selection choices.

0 Kudos
Message 5 of 10
(2,391 Views)

@drjdpowell  ha scritto:

In addition to other described techniques, one can also use "filter" events such as "Mouse Down?" to set the elements in a combo box or ring, based on which array element is clicked on.  This can simulate an array of combo boxes with different selection choices.


This would not work, as selected items in all other combo boxes would change. You would never see in a single view what you selected.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 6 of 10
(2,346 Views)

Are you talking about combo boxes or rings?  What you say is true of rings.

0 Kudos
Message 7 of 10
(2,330 Views)

You are right, I was probably thinking more about rings.

If the combo box is set to Allow Undefined Strings (which is the default anyway), it can retain its value irrespectively of the Strings[] property.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 8 of 10
(2,328 Views)

You can also make a drop down context menu. If the user presses something (mouse down? event) set it to right click. That will trigger the context menu. Catching the menu activation event will allow you to make your own menu.

 

See attachment for a quick and dirty mock up.

0 Kudos
Message 9 of 10
(2,310 Views)

Just to put in my two cents:

I had a similar problem before and solved it with a moving ring as drop-down list. See attached VI.

It creates a list of names and a length-variable list of attached names. These are selectable and changeable for every name- entry.

Greets, Dave
0 Kudos
Message 10 of 10
(2,288 Views)