System.Windows.Forms.ControlBindingsCollection.Add Method

Creates a binding that binds the specified control property to the specified data member of the specified data source, optionally enabling formatting with the specified format string, propagating values to the data source based on the specified update setting, setting the property to the specified value when DBNull is returned from the data source, and adding the binding to the collection.

Syntax

public Binding Add (string propertyName, object dataSource, string dataMember, bool formattingEnabled, DataSourceUpdateMode updateMode, object nullValue, string formatString)

Parameters

propertyName
The name of the control property to bind.
dataSource
An object representing the data source.
dataMember
The property or list to bind to.
formattingEnabled
true to format the displayed data; otherwise, false.
updateMode
One of the System.Windows.Forms.DataSourceUpdateMode values.
nullValue
The object to be applied to the bound control property if the data source value is DBNull.
formatString
One or more format specifier characters that indicate how a value is to be displayed.

Returns

The newly created System.Windows.Forms.Binding

Remarks

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 2.0.0.0