Solved

bind a WPF combo box  item source to a class

Posted on 2013-01-15
1
588 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Having just graduated from college and entered the workforce, I don’t find myself always using the tools and programs I grew accustomed to over the past four years. However, there is one program I continually find myself reverting back to…R.   So …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video teaches viewers about errors in exception handling.
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

803 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