Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Textbox AutoComplete using LIKE rather than START

Posted on 2012-03-15
6
Medium Priority
?
2,892 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 2000 total points
ID: 37725534
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

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…
Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Suggested Courses

730 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