?
Solved

bind a WPF combo box  item source to a class

Posted on 2013-01-15
1
Medium Priority
?
595 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
[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
1 Comment
 
LVL 42

Accepted Solution

by:
sedgwick earned 2000 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

What is a Denial of Service (DoS)?

A DoS is a malicious attempt to prevent the normal operation of a computer system. You may frequently see the terms 'DDoS' (Distributed Denial of Service) and 'DoS' used interchangeably, but there are some subtle differences.

Question has a verified solution.

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

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
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 …
Suggested Courses

771 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