Get a mop and wipe it up!

Binding to IDs in Comboboxes

, posted: 8-Jun-2008 10:26

In .NET WinForms (pre-WPF) you can easily databind to a "lookup" combobox. It's not obvious in MSDN, though.

Links to two methods:

How do I setup a ComboBox to bind to a Lookup table? uses DisplayMember, ValueMember, DataSource and DataBindings.

How do I set the SelectedItem property in a databound ComboBox? uses SelectedIndex and FindStringExact.


More information

Other related posts:
How to get your Windows Azure hosted WordPress contact form working
NuPeek - a local NuGet and Symbol Server for .NET
Caliburn.Micro for Newbies Who Want to Write Clean WP7 Apps - Part 1: How to Configure a New Project With Folders

Add a comment

Please note: comments that are inappropriate or promotional in nature will be deleted. E-mail addresses are not displayed, but you must enter a valid e-mail address to confirm your comments.

Are you a registered Geekzone user? Login to have the fields below automatically filled in for you and to enable links in comments. If you have (or qualify to have) a Geekzone Blog then your comment will be automatically confirmed and placed in the moderation queue for the blog owner's approval.

Your name:

Your e-mail:

Your webpage:

dmw's profile

David White
New Zealand

Goon fan, .NET developer, contrarian seeker of truth