WPF: ComboBox DisplayMemberPath is suddenly not shown anymore?
in my ComboBox I see 3 times this: MyNameSpace.ViewModel.CustomerViewModel ??
Actually this code worked but now don`t know what I changed:
<ComboBox DisplayMe开发者_如何学PythonmberPath="{Binding Path=CustomerName}" SelectedIndex="0" ItemsSource="{Binding CustomersViewModel}" />
Customers is a ObservableCollection
The same code works fine with a ListBox just using DisplayMemberBinding instead of DisplayMemberPath.
What is wrong?
DisplayMemberPath takes a path, not a Binding. So just set DisplayMemberPath="CustomerName".
精彩评论