Click here to Skip to main content
Licence 
First Posted 12 Jul 2004
Views 35,828
Bookmarked 15 times

A client side filtered dropdown for ASP.NET

By | 12 Jul 2004 | Article
Filter a combo box in IE as you type - without posting back at every key press

Sample Image - FilteredDropDownList.jpg

Introduction

Internet Explorer's combo box does not have enough functionality. This is one attempt at giving your site users a better experience, especially if combo boxes are related to each other and need to post back, or if your lists are very long, or even unsorted. It can be an irritating experience for the user to scroll up and down for minutes looking for a value to pick.

Using the code

The code is pretty self explanitory, and uses some javascript for client side work. Compile the FilteredDropDownList class into a web control library, and use it like you would use a normal ASP.NET DropDownList, from which the control inherits.

The ValueStartsWithFilterString property indicates if the text typed must be at the start of the text in the combo box, or anywhere in the combo box item’s text. The TextCSSClass property sets the stylesheet class of the textbox where the filter string is typed. The Text property sets the text in the textbox where the filter string is typed.

Points of Interest

This control is for use with Internet Explorer, some other browsers, like FireFox, already have this functionality in their combo boxes. The code was only tested using Internet Explorer 6.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

marcel27



South Africa South Africa

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralControls works flawlessly Pinmemberfrmaheu5:38 21 Jan '09  
GeneralDoesn't Work Properly Pinmemberjmagi114:42 6 Oct '05  
Questionhow to filter dataset in client Pinmemberjiataiping16:51 13 Jun '05  
GeneralA low vote... PinsitebuilderPaul Watson3:35 17 Jul '04  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web01 | 2.5.120517.1 | Last Updated 13 Jul 2004
Article Copyright 2004 by marcel27
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid