Represents a collection of data bindings on a control.
Object
BaseCollection
BindingsCollection
[Visual Basic] Public Class BindingsCollection Inherits BaseCollection [C#] public class BindingsCollection : BaseCollection [C++] public __gc class BindingsCollection : public BaseCollection [JScript] public class BindingsCollection extends BaseCollection
Controls that can be data bound contain a collection of ListBinding objects. The collection is managed by the BindingsCollection. For a list controls that support data binding, see ListBinding.
Although it is usual to bind a field to a property such as Text, it's also possible to bind to other properties, such as the height or width of a control. This might be used to create controls using data in a DBMS. Therefore a control can have multiple bindings between its various properties and fields in a database.
Namespace: System.WinForms
Assembly: System.WinForms.dll
The example below shows the most common form of data binding: binding a Text property of a TextBox control to a field in a database.
[Visual Basic]
Private Sub BindControl() Dim ds As DataSet ' Not shown: getting the data into the DataSet. Text1.Bindings.Add("Text", ds.Tables("Products"), "ProductName") End Sub
BindingsCollection Members | System.WinForms Namespace | ListManager