BindingMemberInfo.BindingMember プロパティ

定義

データ バインド オブジェクトのプロパティ名を指定するために使用する情報を取得します。Gets the information that is used to specify the property name of the data-bound object.

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

プロパティ値

空の文字列 ("")、単一のプロパティ名、または、最終的にデータ バインド オブジェクトのプロパティ名に解決されるピリオド区切りのプロパティ名の階層。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.

次のコード例ではBindingMemberInfoBindingPathフォーム上Bindingの各のオブジェクトを取得し、 BindingFieldの、 BindingMember 、およびのBindingMemberInfo各プロパティ値を出力します。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.

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

注釈

BindingMemberInfo 、コントロールプロパティ名、データソースBindingMemberInfo 、およびナビゲーションパスを使用してコンストラクターを呼び出すと、自動的に作成されます。A BindingMemberInfo is created automatically when you call the BindingMemberInfo constructor with a control-property name, data source, and navigation path. パラメーター dataMemberには、 BindingMember文字列が含まれています。The dataMember parameter contains the BindingMember string.

は、 BindingPathとのBindingField値のピリオド区切りの組み合わせです。BindingMemberThe BindingMember is the period delimited combination of the BindingPath and BindingField values. たとえば、"customers. Binding BindingMember custtoorders. orderdate" dataMemberというパラメーターを使用して新しいを作成した場合、は "customers. custtoorders. orderdate" を返します。For example, when a new Binding is created by using a dataMember parameter of "Customers.custToOrders.OrderDate", BindingMember will return "Customers.custToOrders.OrderDate".

適用対象

こちらもご覧ください