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.
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.
08-27-2014 03:12 PM
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!
08-27-2014 03:28 PM
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.
08-27-2014 03:59 PM
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:
08-27-2014 04:15 PM
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.
08-27-2014 04:31 PM
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.
08-27-2014 04:41 PM - edited 08-27-2014 04:42 PM
@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.
08-28-2014 12:24 AM
Hi,
Please check attached VI it may help you!!!
09-02-2014 08:03 AM
( 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.
09-02-2014 08:23 AM - edited 09-02-2014 08:26 AM
Hi David
I am not sure without pressing control /shift key how will you point how many items you want to select?
09-02-2014 08:29 AM
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.