Reputation: 222
What I want to do is make a DropDownList with a LOT of items from a Database. In that DropDownList I want to be able to type in a part of the value of the element, and that way limit the elements of the DropDownList to only those that contain what I filled in.
For example: When I have a list of products with a name of 10000 to 20000, that's 10.000 items. To prevents having to pick from all of those, I want to type in a value of let's say the items 10000 to 10010. That takes it down to 10 items. For example, only those 10 items contain "Box" in their value. All the other elements don't have "Box" in their value, so they stop showing in the DropDownList until I remove the text.
When it's filtered down to 10 items, I can pick the right one out and select it. When I do that it needs to automatically fill the whole value of that element into a textarea.
Does anyone know how to go about doing that?
Thanks in advance.
Milan.
Upvotes: 0
Views: 1457
Reputation: 28437
You may want to look at the ASP.Net AJAX Control Toolkit. The autocomplete
extender is just what you are looking for.
http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/AutoComplete/AutoComplete.aspx
And as suggested by Chris Hardie, you may have a look at the jQuery UI autocomplete as well: http://jqueryui.com/autocomplete/
Use whatever you are comfortable with.
Upvotes: 1