Export (0) Print
Expand All

BindingsCollection Class

Represents a collection of Binding objects for a control.

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

type BindingsCollection =  
        inherit BaseCollection 

The BindingsCollection type exposes the following members.

Public propertyCountGets the total number of bindings in the collection. (Overrides BaseCollection.Count.)
Public propertyIsReadOnlyGets a value indicating whether the collection is read-only. (Inherited from BaseCollection.)
Public propertyIsSynchronizedGets a value indicating whether access to the ICollection is synchronized. (Inherited from BaseCollection.)
Public propertyItemGets the Binding at the specified index.
Protected propertyListInfrastructure. Gets the bindings in the collection as an object. (Overrides BaseCollection.List.)
Public propertySyncRootGets an object that can be used to synchronize access to the BaseCollection. (Inherited from BaseCollection.)

Protected methodAddAdds the specified binding to the collection.
Protected methodAddCoreInfrastructure. Adds a Binding to the collection.
Protected methodClearClears the collection of binding objects.
Protected methodClearCoreInfrastructure. Clears the collection of any members.
Public methodCopyToCopies all the elements of the current one-dimensional Array to the specified one-dimensional Array starting at the specified destination Array index. (Inherited from BaseCollection.)
Public methodCreateObjRefCreates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from MarshalByRefObject.)
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetEnumeratorGets the object that enables iterating through the members of the collection. (Inherited from BaseCollection.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetLifetimeServiceRetrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodInitializeLifetimeServiceObtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
Protected methodMemberwiseClone()Creates a shallow copy of the current Object. (Inherited from Object.)
Protected methodMemberwiseClone(Boolean)Creates a shallow copy of the current MarshalByRefObject object. (Inherited from MarshalByRefObject.)
Protected methodOnCollectionChangedRaises the CollectionChanged event.
Protected methodOnCollectionChangingRaises the CollectionChanging event.
Protected methodRemoveDeletes the specified binding from the collection.
Protected methodRemoveAtDeletes the binding from the collection at the specified index.
Protected methodRemoveCoreInfrastructure. Removes the specified Binding from the collection.
Protected methodShouldSerializeMyAllGets a value that indicates whether the collection should be serialized.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)

Public eventCollectionChangedOccurs when the collection has changed.
Public eventCollectionChangingOccurs when the collection is about to change.

Simple data binding is accomplished by adding Binding objects to a BindingsCollection. Any object that inherits from the Control class can access the BindingsCollection through the DataBindings property. For a list of Windows controls that support data binding, see the Binding class.

The following example binds the Text property of a TextBox control to a field in a database.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
© 2014 Microsoft