我假设 ComboBox 中的 Textsearch 在 ComboBox 顶部给我一个文本输入框,当我输入时会过滤掉,我是否正确?
如果是这样,我不明白为什么它不起作用。我有一个 ComboBox,其 ItemsSource 通过 DataContext 绑定(bind)到 ListCollectionView。我将 IsTextSearchEnabled 设置为 true,并将 TextSearch.TextPath 设置为 ListCollectionView 中对象类型的属性:
<ComboBox ItemsSource="{Binding Path=PersonCollection}"
TextSearch.TextPath="Name" DisplayMemberPath="Name" IsTextSearchEnabled="True"/>
但是我从来没有得到任何输入框。
该属性确实像我在 DisplayMemberPath 中设置的那样显示。
我假设错了吗?如果错了,文本搜索是如何工作的?
最佳答案
您必须将 IsEditable 设置为 true。
关于c# - WPF:如何使用 ComboBox TextSearch?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4088744/