开发者

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".

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜