WinForms Databinding, Part II: Format & Parse

Posted on November 14, 2005

In my last entry, I described the .NET 1.1 simple data binding mechanism: an object property is bound to a control property, and a change in either the object property value or the control property is reflected in the other.  Today, I will describe what happens when these two properties are of different types. For the following discussion, assume an Invoice class with an integer Amount property.  The Amount property of an Invoice is bound ...

Read More

WinForms Databinding, Part 1

Posted on June 16, 2005

The basic idea behind databinding is simple. You have some source of data, and you have a control. When the data changes, you want the control to update to reflect the new value. When the control is changed (typically the control text), you want the data to change. Databinding is the term for the auto-magic process that does this. Consider a form that contains a TextBox and an instance of a class that exposes some data: public class ...

Read More