【发布时间】:2015-05-13 20:20:29
【问题描述】:
我正在使用Extended WPF Toolkit's CheckComboBox。绑定工作正常。使用自定义ItemTemplate 时,如何显示选定的名称
简 - 老师,约翰 - 开发人员,乔 - 护士
在Text 属性中?将DisplayMemberPath 与ItemTemplate 一起使用不起作用。
<xctk:CheckComboBox ItemsSource="{ Binding Path=Customers }" Delimiter=","
ValueMemberPath="Id" SelectedValue="{ Binding SelectedCustomerIds }"
ItemTemplate="{ StaticResource ccBTemplate }" />
<DataTemplate x:Key="ccBTemplate ">
<TextBlock Text="{ Binding Path=Name }" />
<TextBlock Text="{ Binding Path=JobTitle }" />
</DataTemplate>
【问题讨论】:
-
您能否提供更多信息,说明您的对象结构在数据方面是什么样的?
-
不完全确定
the selected items is not displayed in the checkcombobox like it was while using displaymemberpath的意思。你到底看到了什么? -
将 DisplayMemberPath 添加到
<xctk:CheckComboBox DisplayMemberPath="Name" .../>
标签: wpf xaml datatemplate