LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to havedrop down lists in cells of a table?

Hi -

I have LV7.1 Dev Suite. I would like to create a table that I can have drop-down lists in any given cell of the table. Is there a way to do this with the "table" selection in the lists & tables section of the controls palette?

Thanks for any help.

Rob
0 Kudos
Message 1 of 16
(5,911 Views)
"I would like to create a table that I can have drop-down lists in any given cell of the table."

A table is a special kind of a 2D array of strings. so you cannot have that drop-down list.

However, you can create a 2D array, with elements that are 'enumtype or text ring, etc), and each element will then have a drop-dwon list as defined
0 Kudos
Message 2 of 16
(5,904 Views)
Indirectly.

You can use a text ring control. Normally this control is hidden. When the mouse is clicked inside a cell the ring control shows up inside that cell and you can select the item. The selected item can then updated into the cell. You can also dynamically update the displayed items on the ring control.

-Joe
0 Kudos
Message 3 of 16
(5,894 Views)
I couldn't resist trying this (attached, LV 7.1.1). My version is a little flakier than I expected it to be, but it definitely makes for a neat UI.

--John
Message 4 of 16
(5,865 Views)
Thanks everyone for the replies and tips. And especially Johnner for the great example.

I came from LV 5.1 a couple of months ago. There are many new tricks and tools I'm in need of figuring out. Anyone have a suggestion for a good book?

Thanks.

Rob
0 Kudos
Message 5 of 16
(5,857 Views)
The example was Joe's exact idea, but thanks for the kind words.

I don't have any book recommendations, but if you were intermediate with LabVIEW 5.1 and want to get a good feeling for the new functionality added since then, I would suggest taking a couple of hours and taking a look at as many of the examples in Example Finder (Help >> Find Examples) as you can. That will ensure that you hit all of the new functionality that has been added since then.

Take care,
John
0 Kudos
Message 6 of 16
(5,854 Views)
Another option that is a bit more extensible is to use a borderless VI launched when you click/context-click on the table. Use the mouse-down event to launch it. I don't have an exact example, but the attached context menu example (LV7.0) shows the basic principle and may be more what you want anyway. You can dynamically change the size and number of elements in the borderless VI to anything you want before you open it.
0 Kudos
Message 7 of 16
(5,824 Views)

Hello,

 

  I downloaded this vi and tried it, it works really nice. However I it requires that you select an item from the list box before you move on to another cell. If you move on to another cell before selecting a item from the list box (which you can do) the code gets out of sync with the table.

   So is there a way to require the user to select a value from the list box before they are allowed to select another cell?

Regards,


Kaspar
0 Kudos
Message 8 of 16
(4,197 Views)

There are likely many ways to get around what you want.  One thing you could try is read which row the mouse is over by using the Point to Row invoke node on the listbox, and then set the value of the listbox before attempting to populate the drop down.

0 Kudos
Message 9 of 16
(4,178 Views)

I haven't looked at the VI posted earlier in this thread, but see if this http://forums.ni.com/t5/LabVIEW/array-of-cluster/m-p/1822451#M625032 does what you want. It uses a ring or enumeration positioned over a cell of a table to make it appear that the drop-down is part of the table.

0 Kudos
Message 10 of 16
(4,167 Views)