Solved

How to search string in combobox vb.net

Posted on 2011-03-22
5
1,432 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

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 create an MVC5, Razor Widget 2 26
location of a form 2 25
How can I run RAW complex query's with Entity Framework Core 1 37
Change to file doesn't show up 16 52
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

856 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