Export (0) Print
Expand All

BindingMemberInfo Structure

Contains information that enables a Binding to resolve a data binding to either the property of an object or the property of the current object in a list of objects.

For a list of all members of this type, see BindingMemberInfo Members.

System.Object
   System.ValueType
      System.Windows.Forms.BindingMemberInfo

[Visual Basic]
Public Structure BindingMemberInfo
[C#]
public struct BindingMemberInfo
[C++]
public __value struct BindingMemberInfo

[JScript] In JScript, you can use the structures in the .NET Framework, but you cannot define your own.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Remarks

The BindingMemberInfo is returned by the BindingMemberInfo property of the Binding class.

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

Example

[Visual Basic, C#, C++] The following example prints the BindingPath, BindingField, BindingMember for each control on a form.

[Visual Basic] 
Private Sub PrintBindingMemberInfo()
  Dim c As Control
  Dim b As Binding
  For Each c In  Me.Controls         
     For Each b In  c.DataBindings
        Console.WriteLine(ControlChars.Cr + c.ToString())
        Dim bInfo As BindingMemberInfo = b.BindingMemberInfo
        Console.WriteLine("Binding Path " + ControlChars.Tab _
                          + bInfo.BindingPath)
        Console.WriteLine("Binding Field " + ControlChars.Tab _
                          + bInfo.BindingField)
        Console.WriteLine("Binding Member " + ControlChars.Tab _
                          + bInfo.BindingMember)
      Next b
   Next c
End Sub

[C#] 
private void PrintBindingMemberInfo()
{
   foreach(Control c in this.Controls)
   {
      foreach(Binding b in c.DataBindings)
      {
         Console.WriteLine("\n" + c.ToString());
         BindingMemberInfo bInfo = b.BindingMemberInfo;
         Console.WriteLine("Binding Path \t" + bInfo.BindingPath);
         Console.WriteLine("Binding Field \t" + bInfo.BindingField);
         Console.WriteLine("Binding Member \t" + bInfo.BindingMember);
      }
   }
}

[C++] 
private:
   void PrintBindingMemberInfo() {
      System::Collections::IEnumerator* myEnum = this->Controls->GetEnumerator();
      while (myEnum->MoveNext()) {
         Control* c = __try_cast<Control*>(myEnum->Current);
         System::Collections::IEnumerator* myEnum = c->DataBindings->GetEnumerator();
         while (myEnum->MoveNext()) {
            Binding* b = __try_cast<Binding*>(myEnum->Current);
            Console::WriteLine(S"\n {0}", c);
            BindingMemberInfo bInfo = b->BindingMemberInfo;
            Console::WriteLine(S"Binding Path \t {0}", bInfo.BindingPath);
            Console::WriteLine(S"Binding Field \t {0}", bInfo.BindingField);
            Console::WriteLine(S"Binding Member \t {0}", bInfo.BindingMember);
         }
      }
   }

[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

Namespace: System.Windows.Forms

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

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

See Also

BindingMemberInfo Members | System.Windows.Forms Namespace | Binding | Binding | DataSource | PropertyName

Show:
© 2014 Microsoft