ASP.NET Listbox: How to implement interactive string search?

huangs3
huangs3 used Ask the Experts™
on
Hi Experts:

    I made a web page with a listbox control displaying a long list of iterms for user to choose.
    To make it easier for user to select an item from the list box, I want to make it ideally like this: when user quickly type in several characters like "ABC", the first item in the list box start with "ABC" will be highlighted (just like how our desktop windows explorer works).

    Considering carefully it doesn't seem easy, but there may still be a way to implement:
1. need to keep track of time period between two key-ins to decide whether they should be considered as one search input.
2. cannot use post back on key stroke event because this way will neither be user friendly, nor be able to keep track of a sequence of keys due the web page refreshing.
3. in my current imagination Javascript may be valid to implement it, because it wouldn't cause complete refresh of webpage. However, I  still need the way to keep track to the key stroke time.

    Can you let me know if you have a way to do that?

    Thank you!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Author

Commented:
Hi jamesrh:

    Thank you and it is a product that provides the functionality, but I forgot to tell that there are restrictions in my development environment... I cannot use these third party user controls, unless it has been approved...
    The resources I current have are the standard controls in Visual Studio 2005, and the AJAX controls from http://www.telerik.com 
    Is there any sample code I can follow? or any way of using telerik controls to do this?
    Thank you!

Commented:
FYI, these controls are from Microsoft. No additional license cost.
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Commented:
If you are able to switch to a telerik combobox instead of listbox you would get automatic autocomplete.

Author

Commented:
Hi Jamesrh:

    I am looking at the first link you gave me.
    Telerik combox doesn't seem to work, because it only allows me to select one item at the same time, but I also want to use the list box to support multi-select.

Author

Commented:
Thank you, this should work.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial