BindingContext.Item Property (Object)

 

Gets the BindingManagerBase that is associated with the specified data source.

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

Public ReadOnly Property Item (
	dataSource As Object
) As BindingManagerBase

Parameters

dataSource
Type: System.Object

The data source associated with a particular BindingManagerBase.

Property Value

Type: System.Windows.Forms.BindingManagerBase

A BindingManagerBase for the specified data source.

Use this overload if the BindingManagerBase you want does not require a navigation path. For example, if the BindingManagerBase manages a set of Binding objects that use an ArrayList or DataTable as the DataSource, no navigation path is required.

System_CAPS_noteNote

The Item property will always return a BindingManagerBase, and never return null.

See the Binding class for a list of possible data sources and for information about creating bindings between controls and data sources.

The following code example returns three BindingManagerBase objects: one for a DataView, one for an ArrayList, and one for the DataSource of a Binding that belongs to a TextBox control.

Private Sub ReturnBindingManagerBase()
   ' Get the BindingManagerBase for a DataView. 
   Dim bmCustomers As BindingManagerBase = _
      Me.BindingContext(myDataView)

   ' Get the BindingManagerBase for an ArrayList.
   Dim bmOrders As BindingManagerBase = _
      Me.BindingContext(myArrayList)

   ' Get the BindingManagerBase for a TextBox control.
   Dim baseArray As BindingManagerBase = _
      Me.BindingContext(Text1.DataBindings(0).DataSource)
End Sub

.NET Framework
Available since 1.1
Return to top
Show: