Click here to Skip to main content
15,917,565 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear genius,

I finished the code in customizing a dropdownlist which can not only write but also select the items which already had. But I have no idea in searching the item which are existing while write something in the dropdownlist. HELP!!! Thank you very much.

For example , when I would like to select the item which named "12345". As soon as I typed the word--"1" , it comes to the item "12345". And then I can select the item as soon as I click it. Help!!!!
Posted

Try adding the following to your dropdown:
C#
comboBox1.AutoCompleteMode = AutoCompleteMode.Suggest;
comboBox1.AutoCompleteSource = AutoCompleteSource.ListItems;

This sets the auto complete to work from the list content. You may want to play with the AutoCompleteMode until it does what you want exactly.
 
Share this answer
 
Thanks a lot for OrigianlGriff's ans. I know how to solve the question by your generous ans. Thanks! Finally I found what I want at ComboBox Control for ASP.NET[^]

[edit]Don't add an answer to say that! Edit your original question instead, so that all the info is get together for others, and use the "Accept Answer" button to close the question. That way it doesn't hang around to clog up the system with answered questions! OriginalGriff.

P.S. You are welcome![/edit]


Thanks for your reminding.
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900