Data Binding MM .NET Windows Forms Controls
When it comes to data binding in .NET, there are three main types of controls:
- Simple bound controls (text boxes, labels, buttons, etc.)
- List controls (combo boxes, list boxes, etc.)
- Data Grids
For more information on binding to these three different types of controls, check out the "See also" Help links listed at the bottom of this topic.
Common Binding Properties
All MM .NET user interface controls have the following common binding properties that allow you to easily bind to them without writing any code:- BindingFlag
- BindingProperty
- BindingSource
- BindingSourceMember
Note: If you do not want to use these custom MM .NET properties, you can still use standard Windows Forms data binding by using the built-in .NET data binding properties.
The BindingFlag Property
BindingFlag is a boolean property that allows you to specify whether a particular control should be data bound. If you want to temporarily turn off data binding for a particular control, just set its BindingFlag property to false.The BindingProperty Property
BindingProperty allows you to specify the property of the user interface control that is data bound. By default, this is set to Text.The BindingSource Property
The BindingSource property specifies the business object that is the data source for the user interface control. You can manually enter the business object class name, or use the Binding Source Selection dialog. When you select the BindingSource property in the Properties Window, a small command button (...) appears to the right of the property:
If you click this button, the Binding Source Selection dialog appears:
This dialog displays a list of business objects that have been registered with your form (for details on registering business objects, see the section Registering Business Objects with a Windows Form). You can select a business object from this dialog by double-clicking a selection in the list box, or by selecting a business object and clicking the OK button.
Tip: You can set the BindingSource property of multiple user interface controls simultaneously by selecting the user interface controls in the IDE, then launching the Binding Source Dialog.
The BindingSourceMember Property
The BindingSourceMember property specifies the data source member (usually a DataTable or DataView column) the user interface control is bound to. You can manually enter a BindingSourceMember value in the Properties Window, or use the Binding Source Member Selection dialog. In the Properties Window, when you select a control's BindingSourceMember property, a small command button (...) appears to the right of the property:
If you click this button, the Binding Source Member Selection dialog appears:
This dialog is data driven from your application's configuration file (app.config for Windows forms). For more information, see the Help topic Database Settings in the Application Configuration File.
Database Sets
If you have database sets specified in your application configuration file, you will see these listed in a Database Sets combo box in the upper left corner of the dialog. When you select a database set, the Databases combobox, Tables list box and Fields list box are updated accordingly. If you do not have database sets specified in the config file, this combo box does not appear at all.Databases
The Databases combo box contains a list of all databases for the currently selected database set. If you don't have any database sets, this combo box contains a list of all databases listed in the config file. When you select a database from this combo box, the Tables list box and Fields list box are updated accordingly.Tables
The Tables list box contains a list of all tables for the currently selected database. If you select a table from this list box, the Fields list box is updated accordingly.Fields
The Fields list box contains a list of all fields for the currently selected table.Include Table Name
If this checkbox is selected, when you click the OK button, both the table name and the field name are placed in the BindingSourceMember property. If this checkbox isn't selected, only the field name is placed in the BindingSourceMember property.
Note: Do not select this checkbox unless the selected table name is the same as the default TableName property specified in the business object, or some other table name within a DataSet of the business object!
Typically, you can leave this checkbox unselected if the user interface control is bound to the business object's default DataTable.
Binding to DataViews
If you are binding to DataViews rather than DataTables, you can use this dialog to quickly specify the DataTable and data column you want to bind to, then afterwards go back to the Properties Window and manually prefix the name of the column with the name of the DataView (for example, Orders.dvOrders.OrderID).See Also
Data Binding Simple Bound Windows Forms Controls | Data Binding Windows Forms List Controls | Data Binding Windows Forms Data Grids | Specifying Connection Strings and Database Settings
© (c) 2026 Oak Leaf Enterprises, Inc., 1996-2026 • Updated: 02/12/26
Comment or report problem with topic
