LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dropdown

Hi To All,

 

I need a help in creating customizable Dropdown. In my code, I have designed a dropdown using "Combo Box". I have inserted the strings("Device names" to be specific). Now, is there a mechanism through which I can lock the option selected in this "Dropdown" so that I should not be able to use it again. 

 

Eg: I have a dropdown containing Dev1,Dev2,Dev3,Dev4. I choose Dev1 1st time. For the 2nd time, I should not be able to choose Dev1(either it should be locked to deleted from the dropdown).

 

I hope the problem is clear. If not please let me know if you require further details. Also is the Combo box the solution to this problem? or can I use any other option(like ring or enum) which does the functionality explained above??

 

Thanks & Regards,

SUshruth.

 

0 Kudos
Message 1 of 10
(3,499 Views)

Hello,

 

I don't you can "disable" items from a combo box, you can do that with rings and enums though, by using property node "Disabled Items" and feeding the entry with an array of the indices you want to disable.

 

Maybe one work around if you want to keep the combo box is to re-populate it wituout the forbidden items...

 

Hope this helps.


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 2 of 10
(3,493 Views)

I don't know of a simple method to disable a single (or multiple) elements within a combo box.

You could delete the selection from the combo box by removing it from Strings[] using a Property Node.

In other words, read the Strings[] array, find the matching selection, remove it from the Strings[] array and write it back to the Property Node.

 

As a result, it will no longer appear in the selection.

0 Kudos
Message 3 of 10
(3,492 Views)

Thanks a lot for the swift reply guys.I checked out for Ring, were there is the option of "Delete item" in property node. But its a numeric datatype right?Is there a way to convert it to string?I need to connect the output of this dropdown to another dropdown which selects the device specifications. And I am handling only with string datatypes. Hence is there any conversions(like string/number palette)? Also can you please explain me as to how this "Disable item" property work???I had opted Combo box as its of string datatype. But also want to check out other options.

0 Kudos
Message 4 of 10
(3,482 Views)

hey,

here is a quick demo with à Ring control (in LV 8.5)

hop this helps


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 5 of 10
(3,478 Views)

This sounds like a job for an Enum

 

Enum.png


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 10
(3,466 Views)

Thank a lot.... Will try the code in my prrogram. i need to do lot of changes. But the basic idea was important. thanks a lot for helping me out.

0 Kudos
Message 7 of 10
(3,456 Views)

@KEMLab wrote:

Thanks a lot for the swift reply guys.I checked out for Ring, were there is the option of "Delete item" in property node. But its a numeric datatype right?Is there a way to convert it to string?I need to connect the output of this dropdown to another dropdown which selects the device specifications. And I am handling only with string datatypes. Hence is there any conversions(like string/number palette)? Also can you please explain me as to how this "Disable item" property work???I had opted Combo box as its of string datatype. But also want to check out other options.


You can read the ring text with this property node.  I often use this method to manipulate the ring control for repopulation based on other criteria.

 

Ring text property node.png

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 8 of 10
(3,437 Views)

Hi Reese,

 

Is it possible to provide a bit more details on this? I am a beginner, hence if you can help me how this works in the context of my problem, it would be of great help 

 

Thanks & Regards,

Sushruth.

0 Kudos
Message 9 of 10
(3,420 Views)

@KEMLab wrote:

Thanks a lot for the swift reply guys.I checked out for Ring, were there is the option of "Delete item" in property node. But its a numeric datatype right?Is there a way to convert it to string?I need to connect the output of this dropdown to another dropdown which selects the device specifications. And I am handling only with string datatypes. Hence is there any conversions(like string/number palette)? Also can you please explain me as to how this "Disable item" property work???I had opted Combo box as its of string datatype. But also want to check out other options.


Attached is a VI that will remove the selection of the ring control from the drop-down list.  I used Ring.text early to show you how to read the string text of a ring control rather than the integer.  The attached VI uses Strings property node to extract the menu.  From there you can delete it and write the array back to the property node to update the list.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 10 of 10
(3,414 Views)