Solved

How to search string in combobox vb.net

Posted on 2011-03-22
5
1,405 Views
Last Modified: 2012-05-11
Hi,

We are developping an application for our in-house management in ASP.net 3.5 build in VB 2008. There is a combobox fill with hundreads of clients. The operator wants to be able to enter any keyword to select the right client. For exemple:

"Les industries P.H. Tech" (name of the client retrieved from the database in the combobox).
Operator would want to be able to type "Tech" and automatically, it shows the right client in the combo.

How can we do that in ASP.net ?

thanks for your time and help
0
Comment
Question by:Dominic34
5 Comments
 
LVL 53

Expert Comment

by:Dhaest
ID: 35190345
Do you want to autocomplete  the combobox in your application or is it some kind of filtering when you click on a button (after entering a string to search for)


AutoComplete ComboBox in VB.Net
http://www.codeproject.com/KB/cpp/autocomplete_combobox.aspx

Using AutoComplete in the AJAX Toolkit in VB.NET
http://www.ajaxtutorials.com/ajax-tutorials/using-autocomplete-in-the-ajax-toolkit-in-vb-net/
0
 

Author Comment

by:Dominic34
ID: 35190554
For autocomplete, operator have to type the correct beginning of the string. In my example "Les industries P.H. Tech", operator have to type "Les .... " for the autocomplete to work.

Operator wants to be able to enter a keyword, because she doesn't necessarely remember the exact name of each client. So by typing "Tech" in the combobox, it should automatically find the correct client name (Les Industries ....). Is it possible to do that directly in the combobox properties of event without any kind of "search" button ?
0
 
LVL 17

Expert Comment

by:nepaluz
ID: 35190960
You'll have to create your list / disctionary of keywords (probably on load / populating the combobox) and then have the autocomplete event search that list / dictionary.
0
 
LVL 10

Accepted Solution

by:
kdwood earned 500 total points
ID: 35192475
Dominic,

In my opinion, what you are wishing to do with the combobox alone seems like it might be unfriendly for the user.  

How about using the AutoCompleteExtender available in Ajax:

"Partial Auto-Completion - The auto-complete feature of the ComboBox will only match items that start with the first user-typed character. An AutoCompleteExtender's ServiceMethod, on the other hand, can be configured to match items where the user-typed text lies somewhere after the first character in the item. A ComboBox cannot be used in application scenarios that require items to be "partially matched" like this."

http://www.asp.net/ajaxlibrary/act_ComboBox.ashx
http://www.infinitezest.com/articles/the-structure-and-usage-of-autocompleteextender-control.aspx

Regards,

Keith



0
 

Author Closing Comment

by:Dominic34
ID: 35193166
thanks! that's what I was looking for!
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

746 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

11 Experts available now in Live!

Get 1:1 Help Now