Jump to content

Populating a combo box dynamically


c_w_k

Recommended Posts

Hello,

I'm sure this is going to be a simple solution, but I'm trying to simply populate a combo box with values that have been put into a string array. I can get the first element of the array to show up in the combo box but not the second element. Any solutions or ideas would be greatly appreciated. I've attached the section of code that I'm trying to accomplish this with. I'm trying to get the name of the devices (which i get back from a dll), I put the names of the devices into the stringOptions array, and then I input the stringOption array into the String values of the Combo Box properties node....this will show the first element of the array in my combo box, but not the second.

Thanks

CK

post-15930-12632533069_thumb.jpg

Link to comment

I'm not sure I follow the description of your problem. My first thought was that you're trying to do this:

post-7534-126325771174_thumb.jpg

... which clearly works for me. What am I misunderstanding?

Thats what I am trying to do, except with a string array, their are only 2 elements in my array right now but I can only see the "0" element of the array. The string array that I am using is dynamic, based on how many devices are found on the network it could contain 2 or more elements. I'm using a local variable of the array to plug into the combo box properties node.

also, I can see both elements in the actual array....just not in the combo box.

Link to comment

Thats what I am trying to do, except with a string array, their are only 2 elements in my array right now but I can only see the "0" element of the array. The string array that I am using is dynamic, based on how many devices are found on the network it could contain 2 or more elements. I'm using a local variable of the array to plug into the combo box properties node.

also, I can see both elements in the actual array....just not in the combo box.

Not sure if this answers your question, but could you use a listbox? It provides a property node that allows you to adjust the number of visible rows.

Link to comment

[...] I can see both elements in the actual array....just not in the combo box.

When you say you can't see both elements in the combo box, are you saying that only one is in the drop-down list or that you want to see both of them without clicking on anything?

Link to comment

When you say you can't see both elements in the combo box, are you saying that only one is in the drop-down list or that you want to see both of them without clicking on anything?

Right, only 1 was in the drop down list, even when I extended the list.....however, after looking over all pieces of my code I found an error :frusty: .....it was only gathering 1 piece of information into the array...therefore there was only 1 element....thats why I was not seeing the second element.

The post you made above worked fine for me as well both with integers and strings......sorry for the false issue, I appreciate your efforts in trying to help me.

Thanks

CK

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.