?
Solved

ComboBox, fill Value and Display text

Posted on 2003-03-03
3
Medium Priority
?
448 Views
Last Modified: 2012-06-27
I need to populate a combo box on a windows form with key/value pairs manually. I do not want to do it binding to a query. How then can I set the Value and the Text for the item added??? Shouldn't this be pretty straight forward?
0
Comment
Question by:tpatten
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 2

Expert Comment

by:wiseguy_2112
ID: 8059439
The Windows ComboBox doesn't have a Value property in its collection.  It is just a list of strings.  To add an item...

comboBox1.Items.Add("string");
0
 
LVL 28

Accepted Solution

by:
iboutchkine earned 60 total points
ID: 8059532
It has DisplayMember and ValueMember. This is a string that specifies the property of the data source whose contents you want to display.
I think that you can do it only from the dataSource such as datatable

0
 
LVL 1

Author Comment

by:tpatten
ID: 8064754
Thanks for the input. What a frustrating way to go about it!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question