BindingsCollection.Item Property (Int32)

 

Gets the Binding at the specified index.

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

public Binding this[
	int index
] { get; }

Parameters

index
Type: System.Int32

The index of the Binding to find.

Property Value

Type: System.Windows.Forms.Binding

The Binding at the specified index.

Exception Condition
IndexOutOfRangeException

The collection doesn't contain an item at the specified index.

The following example prints the BindingMember value of each Binding in a control's BindingsCollection.

private void PrintBindingInfo()
{
   BindingsCollection bc = text1.DataBindings;
   for(int i = 0; i < bc.Count; i++)
      Console.WriteLine(bc[i].BindingMemberInfo.BindingMember);
}

.NET Framework
Available since 1.1
Return to top
Show: