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
Solved

bind a WPF combo box  item source to a class

Posted on 2013-01-15
1
591 Views
Last Modified: 2013-02-17
Hello experts,
I am new to WPF and working on populating a combo box with information from a class. I have looked at some examples on the web but can't seem to get it to work properly. What I'm trying to do is populate the the items from a class I have set up. I have figured out how to bind the text boxes from the datacontent of the window. But how to bind the items of the combo box to a class. I am using VB.net for the code behind.
Thank you,
John
0
Comment
Question by:DjJohnny
1 Comment
 
LVL 42

Accepted Solution

by:
sedgwick earned 500 total points
ID: 38781717
combobox binding in wpf is tricky cause it works only if you bind to a property and the only property combobox has is Length.
so you wanna use ComboBoxItemString class which has property ValueString to bind to.
check here for example and description:
Step by Step WPF Data Binding with Comboboxes
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
If you haven’t already, I encourage you to read the first article (http://www.experts-exchange.com/articles/18680/An-Introduction-to-R-Programming-and-R-Studio.html) in my series to gain a basic foundation of R and R Studio.  You will also find the …
This video teaches viewers about errors in exception handling.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

790 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