NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

BindingManager.Item

[To be supplied.]

[C#] In C#, this member is the indexer for the BindingManager class.

Overload List

Gets the ListManager associated with the specified data source and data member.

[Visual Basic] Overloads Public Default ReadOnly Property Item(Object, String) As ListManager
[C#] public ListManager this[Object, String] {get;}
[C++] public: __property ListManager* get_Item(Object*, String);
[JScript] BindingManager.Item (Object, String)

Gets the ListManager associated with the specified data source.

[Visual Basic] Overloads Public Default ReadOnly Property Item(Object) As ListManager
[C#] public ListManager this[Object] {get;}
[C++] public: __property ListManager* get_Item(Object*);
[JScript] BindingManager.Item (Object)

Example [Visual Basic]

The example below first creates two bindings between two System.WinForms.DataView objects and four controls. The BindingManager is then used to return the ListManager objects for each control given the appropriate data source.

Note   This example shows how to use one of the overloaded versions of the Item property (BindingManager indexer). For other examples that may be available, see the individual overload topics.

[Visual Basic]

' The following lines go into the Declarations section of the form.
Private lmOrders As ListManager
Private lmProducts As ListManager
Private dvOrders As DataView
Private dvProducts As DataView

Private Sub MakeDataViewObjects()
   ' Not shown: code for getting and populating DataSet objects.
   Dim tOrders As DataTable 
   tOrders = DataSet1.Tables("Orders")
   Dim tProducts As DataTable
   tProducts = DataSet2.Tables("Orders")
   dvOrders = New DataView(tOrders)
   dvProducts = New DataView(tProducts)
End Sub

Private Sub BindControls()
   ' Bind two DataGrid controls and two ComboBoxes to DataView objects.

   Combo1.Bindings.Add("Text", dvProducts, "CompanyName")
   DataGrid1.DataSource = dvProducts
   DataGrid1.DataMember = "Products"

   Combo2.Bindings.Add("Text", dvOrders "Customer")
   DataGrid2.DataSource = dvOrders
   DataGrid2.DataMember = "OrderDetails"
End Sub

Private Sub GetListManagers()
   ' Get the ListManager objects for each data source.
   lmOrders = me.BindingManager(dvOrders)
   lmProducts = me.BindingManager(dvProducts)
End Sub

See Also

BindingManager Class | BindingManager Members | System.WinForms Namespace