01-09-2012 08:22 AM
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.
01-09-2012 08:27 AM
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
01-09-2012 08:28 AM
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.
01-09-2012 09:02 AM
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.
01-09-2012 09:13 AM
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
01-09-2012 10:16 AM - edited 01-09-2012 10:17 AM
This sounds like a job for an Enum
01-09-2012 10:51 AM
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.
01-09-2012 11:17 PM
@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.
01-10-2012 02:16 AM
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.
01-10-2012 07:25 AM
@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.