This documentation is archived and is not being maintained.

BindingManagerBase.Bindings Property

Gets the collection of bindings being managed.

[Visual Basic]
Public ReadOnly Property Bindings As BindingsCollection
[C#]
public BindingsCollection Bindings {get;}
[C++]
public: __property BindingsCollection* get_Bindings();
[JScript]
public function get Bindings() : BindingsCollection;

Property Value

A BindingsCollection that contains the Binding objects managed by this BindingManagerBase.

Example

[Visual Basic, C#, C++] The following example gets the BindingManagerBase for a specific data source. The example then uses the Bindings property to print information about each control bound to the same data source.

[Visual Basic] 
Private Sub PrintBoundControls()
    Dim myBindingBase As BindingManagerBase = Me.BindingContext(ds, "customers")
    Dim b As Binding
    For Each b In  myBindingBase.Bindings
        Console.WriteLine(b.Control.ToString())
    Next b
End Sub 'PrintBoundControls

[C#] 
private void PrintBoundControls()
{
   BindingManagerBase myBindingBase = this.BindingContext[ds, "customers"];
   foreach(Binding b in myBindingBase.Bindings)
   {
      Console.WriteLine(b.Control.ToString());
   }
}


[C++] 
private:
void PrintBoundControls()
{
   BindingManagerBase* myBindingBase = this->BindingContext->Item[ds, S"customers"];
   System::Collections::IEnumerator* myEnum = myBindingBase->Bindings->GetEnumerator();
   while (myEnum->MoveNext())
   {
      Binding* b = __try_cast<Binding*>(myEnum->Current);
      Console::WriteLine(b->Control);
   }
}

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

BindingManagerBase Class | BindingManagerBase Members | System.Windows.Forms Namespace | Binding | BindingContext

Show: