How do I add a Data Source to a ComboBox?

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 9 years and 6 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
SapienScripter
Posts: 1
Last visit: Mon Mar 09, 2015 10:59 am

How do I add a Data Source to a ComboBox?

Post by SapienScripter »

Hi, I am running PowerShell Studio 2012 and I'm trying to populate a combobox with hashtable or datasource. On the ComboBox form properties, I can see a DataSource property but cannot seem to find a way to add a datasource (it is grayed out with "(None)"

I have tried and added a MDB database connection in hopes of enabling this property on the control. What am I missing something? It is clearly available in the UI but I cant find a way to enable it. I need to populate the combobox with a Key/Value pair, something like..

ComboBox with column 1 data:
Key Value
Boston,MA BOS


PowerShell Studio 2012 (latest release)
Windows 7 Enterprise X64

Thanks,
Adam
Last edited by SapienScripter on Thu Sep 04, 2014 7:10 am, edited 2 times in total.
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: How do I add a Data Source to a ComboBox?

Post by davidc »

You have to set the Datasource via the script editor:
PowerShell Code
Double-click the code block to select all.
$comboxBox1.Datasource = $arrayList

David
David
SAPIEN Technologies, Inc.
This topic is 9 years and 6 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.