BindingMemberInfo.BindingPath Property

Definition

Gets the property name, or the period-delimited hierarchy of property names, that comes before the property name of the data-bound object.

C#
public string BindingPath { get; }

Property Value

The property name, or the period-delimited hierarchy of property names, that comes before the data-bound object property name.

Examples

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

C#
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: " + 
         bInfo.BindingMember);
         Console.WriteLine();
      }   
   }
}

Remarks

The BindingPath is the period delimited combination of property names that comes before the BindingField in the navigational path returned by the BindingMember property. For example, when a new Binding is created that has a dataMember parameter of "Customers.custToOrders.OrderDate", BindingPath will return "Customers.custToOrders".

Applies to

Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

See also