BindingMemberInfo.BindingMember Property

Definition

Gets the information that is used to specify the property name of the data-bound object.

C#
public string BindingMember { get; }

Property Value

An empty string (""), a single property name, or a hierarchy of period-delimited property names that resolves to the property name of the final data-bound object.

Examples

The following code example gets the BindingMemberInfo object 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

A BindingMemberInfo is created automatically when you call the BindingMemberInfo constructor with a control-property name, data source, and navigation path. The dataMember parameter contains the BindingMember string.

The BindingMember is the period delimited combination of the BindingPath and BindingField values. For example, when a new Binding is created by using a dataMember parameter of "Customers.custToOrders.OrderDate", BindingMember will return "Customers.custToOrders.OrderDate".

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