This documentation is archived and is not being maintained.

BindingMemberInfo.BindingField Property

Gets the data-bound object's property name.

[Visual Basic]
Public ReadOnly Property BindingField As String
public string BindingField {get;}
public: __property String* get_BindingField();
public function get BindingField() : String;

Property Value

The data-bound object's property name.


The BindingField is the last item found in the navigation path returned by the BindingMember property. For example, if the navigation path is "Customers.custToOrders.OrderDate", the BindingField returns "OrderDate" which names the data-bound property of the data source.


[Visual Basic, C#, C++] The following example gets the BindingMemberInfo object of each Binding on a form, and prints the BindingMemberInfo object's BindingPath, BindingField, and BindingMember property values.

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

private void PrintBindingMemberInfo()
   Console.WriteLine("\n BindingMemberInfo");
   foreach(Control thisControl in this.Controls)
      foreach(Binding thisBinding in thisControl.DataBindings)
         BindingMemberInfo bInfo = thisBinding.BindingMemberInfo;
         Console.WriteLine("\t BindingPath: " + bInfo.BindingPath);
         Console.WriteLine("\t BindingField: " + bInfo.BindingField);
         Console.WriteLine("\t BindingMember: " + 

   void PrintBindingMemberInfo() {
      Console::WriteLine(S"\n BindingMemberInfo");
      System::Collections::IEnumerator* myEnum = this->Controls->GetEnumerator();
      while (myEnum->MoveNext()) {
         Control* thisControl = __try_cast<Control*>(myEnum->Current);
         System::Collections::IEnumerator* myEnum = thisControl->DataBindings->GetEnumerator();
         while (myEnum->MoveNext()) {
            Binding* thisBinding = __try_cast<Binding*>(myEnum->Current);
            BindingMemberInfo bInfo = thisBinding->BindingMemberInfo;
            Console::WriteLine(S"\t BindingPath: {0}", bInfo.BindingPath);
            Console::WriteLine(S"\t BindingField: {0}", bInfo.BindingField);
            Console::WriteLine(S"\t BindingMember: {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.


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

BindingMemberInfo Structure | BindingMemberInfo Members | System.Windows.Forms Namespace | Binding | BindingPath | BindingMember