DataGridComboBoxColumn.DisplayMemberPath 屬性

定義

取得或設定來源物件上某值的路徑,以提供物件的視覺表示方式。

public:
 property System::String ^ DisplayMemberPath { System::String ^ get(); void set(System::String ^ value); };
public string DisplayMemberPath { get; set; }
member this.DisplayMemberPath : string with get, set
Public Property DisplayMemberPath As String

屬性值

String

此來源物件上值的路徑。 登錄的預設值為空字串 ("")。 如需哪些因素會影響值的詳細資訊,請參閱 DependencyProperty

備註

使用這個屬性來定義描述如何顯示資料物件的簡單範本。 DisplayMemberPath設定 屬性相當於在範本中設定 Path 屬性系結的 TextBlock.Text 。 下列範本顯示對等設定的範例。

<DataTemplate x:Key="displaymemberpath">
    <TextBlock Text="{Binding Path=LastName}"/>
</DataTemplate>

適用於

另請參閱