다음을 통해 공유


BindingMemberInfo.BindingField 속성

정의

데이터 바인딩된 개체의 속성 이름을 가져옵니다.

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

속성 값

String

데이터 바인딩된 개체의 속성 이름입니다. 빈 문자열("")일 수 있습니다.

예제

다음 코드 예제에서는 폼의 BindingMemberInfoBinding 값을 가져오고 , 및 BindingMember 속성 값을 BindingMemberInfo인쇄합니다BindingPathBindingField.

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

설명

속성 BindingField 이 반환하는 탐색 경로에서 마지막으로 찾은 항목입니다 BindingMember . 예를 들어 "Customers.custToOrders.OrderDate" BindingMember 라는 매개 변수가 있는 dataMemberBinding 데이터베이스가 만들어지면 "OrderDate"가 반환됩니다.

적용 대상

추가 정보