06-01-2021 12:21 AM
I need to give my users a list of tests to choose from and then do just the tests they selected. Each element in the list would have a string for the test name and a boolean checkbox for the user to select. I'd like to be able to iterate the list of string/boolean.
If I create a cluster and make an array out of it I can't seem to either drag the array of cluster into the multilistbox or set the value of MutiColumn ListBox programatically using the following code:
I also managed to make a pretty MultiColumn ListBox but the check mark is just a picture and not a boolean:
How can I create a list of booleans with a ID string that I can iterate to see what is check and what is not?
06-01-2021 01:41 AM - edited 06-01-2021 01:42 AM
There is a checkbox front panel item and you could use and then use property node --> boolean text to return it's boolean text.
If you really want to use multicolumn listbox with checkboxes and single mouse button presses, then make 2 columns, one with test names and the other empty. When user clicks an item place a checkbox with property node--> item names and at the end of selection check which items have checkboxes.
PS: This is probably all way too convoluted so i'll wait for some knight to correct me 😄
06-01-2021 01:55 AM
Hi davidian,
@davidlan wrote:
If I create a cluster and make an array out of it I can't seem to either drag the array of cluster into the multilistbox or set the value of MutiColumn ListBox programatically using the following code:
I also managed to make a pretty MultiColumn ListBox but the check mark is just a picture and not a boolean
How can I create a list of booleans with a ID string that I can iterate to see what is check and what is not?
You try to set the "Value" of the MCLB: that is something completely different than the text/checkboxes in your images! The "value" holds the selected rows…
You need to set the "items" of the MCLB - that property expects a 2D string array!
The checkbox is "just an image", but there are a lot of other images as well. (You can even add your own images to that list!)
Nobody forces you to add an array of only checkboxes so you can easily create an array of "checkboxes"/"no checkboxes" (aka "empty image") depending on your boolean array and show that instead…
06-01-2021 06:21 AM
seems to do what you need
the only problem is that if you have a value selected and would like to deselect it, you need to click out on another value and then back on the value you want to deselect.
06-01-2021 06:45 AM
Have a look at this library: https://forums.ni.com/t5/Community-Documents/Listbox-Multicolumn-Listbox-and-Tree-Item-Selection/ta-...
06-01-2021 07:05 AM
If you search for 'Listbox Multicolumn Listbox and Tree Item Selection', you'll find a library that does pretty close to what you need. Somehow my comment keeps getting deleted when I post a link.