Click here to Skip to main content
15,860,972 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I want to sort items in listbox.

Example: In my listbox have come items.Also have 1 textbox.Wneh i type any letter in textbox then as per type by letter want to sort items in listbox.

suppose in my listbox have items such as;"ABC","CXZ","CCC","CDE" etc.when i type in textbox as "c" then in listbox all itms get sorted by "c".So in list box shows

"CCC"

"CDE"

"CXZ"

"ABC"

how to do it?
Posted
Comments
AmitGajjar 6-Jun-12 5:45am    
do you want to filter or sort. "There is nothing like sort by C"

You can don this

1) One the TextChange event of textbox write a code to repopulate the list box with filter apply to it.


If you need more information share the code how are you populating the listbox.


Hope this helps , If yes then plz accept and vote the answer. Any queries / questions on this are always welcome.

Thanks & Regards
RDBurmon.Sr.Software Engineer
 
Share this answer
 
Start by checking the documentation[^] for the method you want to implement.
 
Share this answer
 
Hi,
Go through the following link-
listbox.sort[^]
you can use this article with some modification -
Moving and sorting numeric items between ListBox controls[^]
 
Share this answer
 

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