Solved

Textbox AutoComplete using LIKE rather than START

Posted on 2012-03-15
6
2,210 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
  • 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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to open form using item in Listbox. 8 23
.NET 2008 VB and C# 6 39
Help with preventing selection from a combobox 11 34
Visual studio 2015 1 21
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
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…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

809 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