Windows Data Binding
So far, the examples have concentrated
on a single control designed specifically for data binding: the
Windows DataGrid
. But the Windows Forms platform
also supports data binding with just about any control (as
demonstrated a little later in this section) and automatically
synchronizes multiple data-bound controls. This ability goes far
beyond just ADO.NET and the DataSet
. In fact, the
ability to bind a data object to a Windows control depends on the
small set of interfaces shown in Table 12-4.
Interface |
Description |
IList |
Allows simple data binding to a collection of objects of the same
type. For example, you can data bind to an
|
IBindingList |
Provides additional features for notification. This notification
includes when the list itself changes (for example, the number of
items in the list increases) and when the list items change (for
example, the third item in a list of customers has a change to its
|
IEditableObject |
Provides support for editing. In other words, when the user modifies
the control, the changes are applied to the data object. This is
implemented by the |
IDataErrorInfo |
Allows a data object to offer error information a control can bind
to. This information consists of two strings: the
|
Get ADO.NET in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.