WPF ListBox IsEditable = True behavior?
I have a 'ListBox' that I am currently using to fill up items.
However, I need the behavior that is similiar to how a combobox开发者_C百科 behaves as if its 'IsEditable '= "True" .
that is the combox filters the items based on what I enter into the text field...
I want similiar behavior in the ListBox.
And I cannot make use of a ComboBox in this case .. I need to manipulate the listbox to behave like that. Is it possible?
You can. There's no built-in mode like there is for a ComboBox (since by default a ListBox has no text-entry capacity - it just displays items), but you can achieve the same behavior by binding the ListBox to a CollectionView
and using the view's filtering abilities.
This blog post gives an example (with source) for how that's done.
Update: That whole domain seems to be offline, here's that post on the Wayback Machine.
精彩评论