Compartir a través de


BindingMemberInfo.BindingField Propiedad

Definición

Obtiene el nombre de propiedad del objeto enlazado a datos.

public:
 property System::String ^ BindingField { System::String ^ get(); };
public string BindingField { get; }
member this.BindingField : string
Public ReadOnly Property BindingField As String

Valor de propiedad

String

El nombre de propiedad del objeto enlazado a datos. Puede ser una cadena vacía ("").

Ejemplos

En el ejemplo de código siguiente se obtiene el BindingMemberInfo de cada Binding uno de los formularios y se imprimen los BindingPathvalores de propiedad , BindingFieldy BindingMember de BindingMemberInfo.

private:
   void PrintBindingMemberInfo()
   {
      Console::WriteLine( "\n BindingMemberInfo" );
      for each ( Control^ thisControl in this->Controls )
      {
         for each ( Binding^ thisBinding in thisControl->DataBindings )
         {
            BindingMemberInfo bInfo = thisBinding->BindingMemberInfo;
            Console::WriteLine( "\t BindingPath: {0}", bInfo.BindingPath );
            Console::WriteLine( "\t BindingField: {0}", bInfo.BindingField );
            Console::WriteLine( "\t BindingMember: {0}", bInfo.BindingMember );
            Console::WriteLine();
         }
      }
   }
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();
      }   
   }
}
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 =  _
         thisBinding.BindingMemberInfo
         Console.WriteLine(ControlChars.Tab + _
         " BindingPath: "  + bInfo.BindingPath)
         Console.WriteLine(ControlChars.Tab + _
         " BindingField: " + bInfo.BindingField)
         Console.WriteLine(ControlChars.Tab + _
         " BindingMember: "  + bInfo.BindingMember)
         Console.WriteLine()
      Next thisBinding
   Next thisControl
End Sub

Comentarios

BindingField es el último elemento que se encuentra en la ruta de navegación devuelta por la BindingMember propiedad . Por ejemplo, si se crea un nuevo Binding que tiene un dataMember parámetro de "Customers.custToOrders.OrderDate", BindingMember devolverá "OrderDate".

Se aplica a

Consulte también