Solved

Textbox AutoComplete using LIKE rather than START

Posted on 2012-03-15
6
2,415 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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
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

Industry Leaders: 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!

Question has a verified solution.

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

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

738 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