Solved

Textbox AutoComplete using LIKE rather than START

Posted on 2012-03-15
6
1,864 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 74

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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 74

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

706 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now