Solved

Textbox AutoComplete using LIKE rather than START

Posted on 2012-03-15
6
2,653 Views
Last Modified: 2012-03-16
Experts,

I'm trying to find a simple (i'm a beginner) solution or pointers as to how i can modify the AutoComplete on a textbox so that it searches the whole string rather than the start i.e. using a sql LIKE equivalant.

I've created the textbox, set the AutoCompleteMode = Suggest, AutoCompleteSource = CustomSource and the AutoCompleteCustomSource to a AutoCompleteStringCollection() that i have already populated.

It all works as expected but now I would like to modify or override something so that it will return values from mid string. I've searched all over to no avail.

Thanks in advance...

Steve
0
Comment
Question by:stevejebson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 37725038
But how would that work for you users? A benefit of auto-complete is that it highlights the suggested completion so that as you type you erase the suggestion. This allows you to continue receiving suggestions from the auto-complete list. You can't hightlight two disjointed parts of the same string (AFAIK), so how would a user continue to type if the suggestion was not what they were after?
0
 
LVL 1

Author Comment

by:stevejebson
ID: 37725088
might be cross wires here...or maybe i don't fully understand you response. They way I understand it is that the AutoComplete returns values that "start" with the users input, what I'm looking for is the AutoComplete to return values that are "like" the users input e.g.

AutoCompleteList of...

Another Bar
Another Foo
Bar
Foo
Final Bar
Final Foo

If i start typing Foo i want it to show both the Another Foo, Foo and Final Foo in the list as selectable if that makes sense ??
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 37725534
0
[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 37725601
You're correct. I was thinking solely of AutoCompleteSuggest. I forgot about the drop-down option.
0
 
LVL 1

Author Comment

by:stevejebson
ID: 37725732
Nice one, that looks promising CodeCruiser...will look at and get back to you tomorrow.
0
 
LVL 1

Author Comment

by:stevejebson
ID: 37728582
Yay! Liking the listbox linked to the textbox as a solution as shown by CodeCruiser

http://stackoverflow.com/questions/796195/c-sharp-autocomplete

What would really finish it off is if I could auto control the height to grow/shrink depending on number of items in list, quick win on that CodeCruiser ?  ;-)

Gonna award the points anyway, top notch.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question