dotnetmonitor.com

 
Index
Previous
Next

 

A common use of a ComboBox in a data bound application is as a lookup based UI control. From a database perspective, a Lookup control is used to provide the lookup values for a foreign key. For example, assume you have a customer table with a StateID where the StateID is a foreign key into a States table. From a UI perspective, youd like to allow the user to select a State via a ComboBox. To do this, you use Complex Binding to bind the ComboBox to the States table (setting the ComboBox.DisplayMember and ComboBox.ValueMember) and use Simple List Binding to bind the ComboBox SelectedValue to the Customer StateID.
Simple Binding
Complex Binding
Using Simple Binding with a List
Sample: Simple Binding to a List (VS 2005) (VS Project: DataBinding Intro)
Type Conversion
Formatting