Export (0) Print
Expand All

Binding.BindingMemberInfo Property

Gets an object that contains information about this binding based on the dataMember parameter in the Binding constructor.

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

public BindingMemberInfo BindingMemberInfo { get; }

Property Value

Type: System.Windows.Forms.BindingMemberInfo
A BindingMemberInfo that contains information about this Binding.

The BindingMemberInfo is created from the dataMember string passed to the Binding constructor.

The following code example gets the BindingMemberInfo of each Binding on a form, and prints the BindingPath, BindingField, and BindingMember property values for that Binding.

private void PrintBindingMemberInfo()
{
   foreach(Control thisControl in this.Controls)
   {
      foreach(Binding thisBinding in thisControl.DataBindings)
      {
         // Print the control's name and Binding information.
         Console.WriteLine("\n" + thisControl.ToString());
         BindingMemberInfo bInfo = thisBinding.BindingMemberInfo;
         Console.WriteLine("Binding Path \t" + bInfo.BindingPath);
         Console.WriteLine("Binding Field \t" + bInfo.BindingField);
         Console.WriteLine("Binding Member \t" + bInfo.BindingMember);
      }
   }
}

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 3.5, 2.0, 1.0

Community Additions

ADD
Show:
© 2015 Microsoft