BindingMemberInfo.BindingField プロパティ

定義

データ バインド オブジェクトのプロパティ名を取得します。Gets the property name of the data-bound object.

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

プロパティ値

データ バインド オブジェクトのプロパティ名。The property name of the data-bound object. 空の文字列 ("") の場合もあります。This can be an empty string ("").

次のコード例では、フォーム上の各 BindingBindingMemberInfo を取得し、BindingMemberBindingPathBindingField、および BindingMemberInfoの各プロパティ値を出力します。The following code example gets the BindingMemberInfo of each Binding on a form, and prints the BindingPath, BindingField, and BindingMember property values of 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

注釈

BindingField は、BindingMember プロパティによって返されるナビゲーションパスで最後に見つかった項目です。The BindingField is the last item found in the navigation path returned by the BindingMember property. たとえば、"Customers. custToOrders. OrderDate" という dataMember パラメーターを持つ新しい Binding が作成された場合、BindingMember は "OrderDate" を返します。For example, if a new Binding is created that has a dataMember parameter of "Customers.custToOrders.OrderDate", BindingMember will return "OrderDate".

適用対象

こちらもご覧ください