How to filter Combobox items on "OnChangeEvent"?
I want to know how can I omit combox's items based on entered
value in edit section of combobox.assume that I have a combobox with these items:
I want that when I type for example Letter M,combobox shows
just those items which starts with letter M...
How can I do this?
Thanks in advance.
First clear your list and build it up again ...
But where do you get your data from?
Personally, I think this is a bad approach. What if I make a typo? Now I can't see items beginning with another letter. There is a better way around this issue. The default combo box component already does something very nice. When you type the first letter, it scrolls down to the first item that starts with that letter. When you type the second letter, it scrolls down to the first item that begins with those two letters. All you have to do is ensure that the list of items is sorted in alphabetical order.
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne
"I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
March 25th, 2008, 08:25 AM
filter combobox when typing... here is the code
just add this. I put it in the page load
combobox1.AutoCompleteMode = AutoCompleteMode.Suggest
combobox1.AutoCompleteSource = AutoCompleteSource.ListItems