Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF: ComboBox TextSearch, how does it work?

Tags:

c#

combobox

wpf

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 ItemsSource 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?

like image 319
Ingó Vals Avatar asked Nov 03 '10 15:11

Ingó Vals


1 Answers

You have to set IsEditable true.

like image 146
Akash Kava Avatar answered Oct 17 '22 01:10

Akash Kava