feihtthief
feihtthief

Reputation: 7063

How to make ComboBox auto complete within Items

I have a Combo Box with lots of item. For demonstration purposed lets say "one", "two", "three"

I want the user to be able to type the text "e" and have the completion options be reduced to anything that contains the letter "e". Getting it to complete from first letter is easy: Set the combobox Style as DropDown to allow text to be typed in, set the auto completion source to be ListItems and auto completion mode to SuggestAppend.

But how to I extend the functionality to allow searching for items that contain the user text rather than starting with the user text?

Is there an alternative free (preferable open-source) combo-box component that can do this?

All the solutions I'm finding on stack overflow, code-project and the greater google result set seem to either have no answer that did the trick for the question originator or are so specific that I dread attempting to retrofit them to my dozen inter-related combo-boxes.

Upvotes: 0

Views: 1109

Answers (1)

André
André

Reputation: 121

Here's a CodeProject link that does exactly what you described: http://www.codeproject.com/Tips/631196/ComboBox-with-Suggest-Ability-based-on-Substring-S

As the author of the project puts it:

The problem is: you cannot define the way the suggested items are filtered/determined. It's always a 'StartsWith'-search...That's why i decided to write my own class...the input...matches one more item because it's a Contains-search.

Upvotes: 1

Related Questions