Nimgoble / WPFTextBoxAutoComplete

An attached behavior for WPF's TextBox control that provides auto-completion suggestions from a given collection
https://www.nuget.org/packages/WPFTextBoxAutoComplete/
MIT License
101 stars 37 forks source link

It is doing it's job, but what if I want to use 'Contains' instead of 'StartWith' for autocomplete #11

Open jphellemons opened 7 years ago

jphellemons commented 7 years ago

I have it setup and have a List with the data like:

user ID, user first name, last name, companyname

and now people will have to know the ID instead of searching by companyname (contains instead of startswith)

is that possible? or having a panel below the textbox with 5 items which also match (contain/startswith) the searchstring?

Nimgoble commented 7 years ago

The "problem" with that stands out to me is replacing the user's text with something else that they didn't type.

So, let's say you have "123, John, Smith, Github". When the user starts typing "John", do we replace their text with "123, John"? What if that wasn't what they meant? Then we'd have to revert their text to "John", but we haven't kept track of what, exactly, they were typing before we started replacing text?

I guess we could highlight "123, " and, should they start typing something else, we can remove all of the highlighted text...

Scratch that: WPF Textbox doesn't allow multiselection.

jphellemons commented 7 years ago

Well maybe add a stackpanel below the textbox with suggestions and highlight what the user typed. but default the addition for the user input with the 'startswith'

I have a webbased example of what I am trying to say. it's the 1st example in this SO post: http://stackoverflow.com/a/32394157/169714 please click run and typ in the letter 'o'.