dotnetmonitor.com

 
Index
Previous
Next

 

The Windows Forms V1.0 and V1.0 designer required an instance of a type to exist at design time in order to setup design time data binding. The BindingSource provides type binding services such that it can project a type to bound controls as an empty list of that type. This enables both design time and runtime binding to factory based business objects:

public void Initialize()

{

// Design time setup

_bs = new BindingSource();

 

// Design time (or run-time binding to type)

// Controls bound to the BindingSource will act as if they are bound to an empty

// typed list of Customers

_dc.DataSource = typeof(Customer);

}

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