Bindings Property
Collapse the table of content
Expand the table of content

BindingManagerBase::Bindings Property

 

Gets the collection of bindings being managed.

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

public:
property BindingsCollection^ Bindings {
	BindingsCollection^ get();
}

Property Value

Type: System.Windows.Forms::BindingsCollection^

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

The following code 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.

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

.NET Framework
Available since 1.1
Return to top
Show:
© 2016 Microsoft