开发者

WPF: How do I use ComboBox TextSearch?

Am I correct in assuming that Textsearch in a ComboBox gives me a text input box at the top of the ComboBox that filters out when I type in?

If so I do not understand why it's not working. I have a ComboBox with its ItemsSo开发者_如何学Curce bound to a ListCollectionView through the DataContext. I set IsTextSearchEnabled to true and set TextSearch.TextPath to a property of the object type in the ListCollectionView:

<ComboBox ItemsSource="{Binding Path=PersonCollection}"
          TextSearch.TextPath="Name" DisplayMemberPath="Name" IsTextSearchEnabled="True"/>

However I never get any inputbox.

The property definitely works as that is displayed as I did set in DisplayMemberPath.

Am I assuming wrong and if so how does text search work?


You have to set IsEditable true.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜