WPF: ComboBox TextSearch, how does it work?

16,899

You have to set IsEditable true.

Share:
16,899
Ingó Vals
Author by

Ingó Vals

Updated on June 12, 2022

Comments

  • Ingó Vals
    Ingó Vals almost 2 years

    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 got a combobox with it's itemssource bound to a ListCollectionView through the DataContext. I the 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" >
                        </ComboBox>
    

    However I never get any inputbox.

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

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

  • Ingó Vals
    Ingó Vals over 13 years
    I had seen alot of examples but never noticed IsEditable being set. It works, thank you.