12-03-2020 02:45 AM
Hello
I was wondering if there is a front panel item that would behave as an excel table in a sense that you could select multiple cells by holding down CTRL (to select multiple different items) or SHIFT (to select a range of items).
I have tried Multicolumn Listbox, which only allows a single item selection, and Table Control, which allows a range of items to be selected, but not multiple different items. Table Control also enters "edit" mode upon clicking on a cell, even if editing is disabled.
Tree item allows neither properly so it's out.
Basically what i need is a list of items (with columns such as ID and some descriptors) from which you could select several and delete them.
I can't do it with radio buttons or similar either, as there are up to 200 different items on the list and it needs to be scrollable.
Examples:
list of items
Selected items 1 and 3
Selected range of items 1 through 3
Thanks for your help
Solved! Go to Solution.
12-03-2020 03:08 AM
Hi AeroSoul,
@AeroSoul wrote:
I have tried Multicolumn Listbox, which only allows a single item selection,
In a MultiColumnListbox you can select more than just one item. You just need to allow such selections…
12-03-2020 03:17 AM
Thanks for a fast answer.
How can i enable this option?
Property node Selection Mode doesn't seem to work (i can only input values 0 and 1, anything greater returns an error upon starting the VI).
And how can i tell which cells are selected? Table Control has a property node of Selection Start and Selection Size, but i don't see this option for Listbox.
12-03-2020 03:30 AM
Hi AeroSoul,
@AeroSoul wrote:
How can i enable this option?
Use the context menu (aka right-click menu) of the MCL: there you can choose the selection mode…
@AeroSoul wrote:
And how can i tell which cells are selected?
The MCL value is an array containing the indices of selected rows when you allow a multiselection mode…
12-03-2020 03:39 AM
I mistakenly wrote a long response to this, but actually the better answer is as follows:
@AeroSoul wrote:
I was wondering if there is a front panel item that would behave as an excel table in a sense that you could select multiple cells by holding down CTRL (to select multiple different items) or SHIFT (to select a range of items).
I have tried Multicolumn Listbox, which only allows a single item selection,...
The bit in red isn't true - right click on your listbox and go to Selection Mode, then choose "1 or more items" (or 0+, if you want to allow no selection), then perhaps also choose "Highlight Entire Row". The default datatype becomes an array of indices selected.
See the following example:
This (at least in 2019) allows the Ctrl / Shift behaviour you wanted.
12-03-2020 03:41 AM
12-03-2020 03:47 AM
Thank you very much, works like a charm!
12-08-2020 07:41 AM
I have another question.
Is there a way to tell if the selected item is index 0 (first item on the list) or no item is selected?
Because value of both is the same and it kinda screws with my selection. Currently i bypass this by leaving the first row empty.
12-08-2020 08:28 AM - edited 12-08-2020 08:29 AM
@AeroSoul wrote:
I have another question.
Is there a way to tell if the selected item is index 0 (first item on the list) or no item is selected?
Because value of both is the same and it kinda screws with my selection. Currently i bypass this by leaving the first row empty.
This shouldn't happen - if you want to allow not having anything selected, make sure you have the selection mode set to "0 or more items" and not "1 or more items".
Then, the default output (without nothing selected) should be an empty array, like this:
until you select something. (The elements in "Array" are all greyed out, indicating they're empty).
You can hold Control and click the same item to deselect it.
A selected row 0 would appear like this:
(I failed to select the "Highlight Entire Row", so it looks a bit odd here, but you could choose that option too as I mentioned before and showed in my first post).