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: 

Using a Multicolumn Listbox To Retrieve Selection Items

Hello, I want to use a Multicolumn Listbox as a control.  This control will popup to a user and the user can select as many items (rows) as they would like.  When they are done with selecting which items (rows) they would like to select they hit the Done key to end the selection process.  Programatically, I then would like to create an array for all of the items (rows) selected.  I have two headers: Test Code and Test Name.  I would like to programatically create an array with the Test Codes and the Corresponding Test Names.

 

I think I can do this with property nodes but I am a bit new to using Listboxes.  What is the best way to do this?

 

Thanks!

0 Kudos
Message 1 of 19
(8,078 Views)

A multicolumn listbox allows you to select 0 or more items by right-clicking on the control...Selection Mode....0 or more (or 1 or more depending on your requirements).  You'll want to setup an event to fire when the value of the control changes.  The new value will be an array of indexes that were selected by the user. 

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 2 of 19
(8,068 Views)

Thanks Aputman...If I have two columns of data for each row, is there a way to return that information based on only the selected items?

 

For example - My two column headers are:

 

Test Code and Test Name

 

Is there a way to return the Test Code and Test Names based on the selected rows?

 

My list box looks like the following:

 

Listbox.png

0 Kudos
Message 3 of 19
(8,062 Views)

Hello hobby1,

 

I think you could use the invoke node of the multicolumn listbox which is "Point to Row Column". This property gives you the location of the selected row. See the example below. Any doubt just post it.

Message 4 of 19
(8,052 Views)

Use a property node with the Item Names selected.  This will return an array of your data.  All you have to do is index that array with the new value array returned by the event to give you another array with the selected Test Code and Test Name columns.  Try it out and if you have trouble, i can show you.  Best way to learn is to try.yourself.  Smiley Happy

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 5 of 19
(8,043 Views)

@manel549 wrote:

Hello hobby1,

 

I think you could use the invoke node of the multicolumn listbox which is "Point to Row Column". This property gives you the location of the selected row. See the example below. Any doubt just post it.


Manel,

I don't think this is a good idea.  That method only seems useful on a table where you can select a single cell.  In a multi-column listbox, you are only concerned about the row(s) selected.  That method only returns one point for one row/column combination.  And honestly, I may be wrong because i don't use that method.

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 6 of 19
(8,041 Views)

 

Hi,

Please check attached VI it may help you!!!

With Regards

Miraz
Kudos is better option to thank somebody on this forum
------------------------------------------------------------------------------
Message 7 of 19
(8,015 Views)

( to hijack this thread) Thanks that is just what I was looking for.

Now if I could select multiple items without the control / shift keys it would be perfect.

 

0 Kudos
Message 8 of 19
(7,943 Views)

Hi David

 

I am not sure without pressing control /shift key how will you point how many items you want to select?

 

0 Kudos
Message 9 of 19
(7,933 Views)

If you hold down the cntl key you can click on an item to select it, or if already selected deselect it, and add and remove selections till you have the list you want. Then you click done.

What I would like is this usage without needing to hold down the cntl key.

 

0 Kudos
Message 10 of 19
(7,924 Views)