Click here to Skip to main content
15,900,461 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In C# windows application I have cboSearch(combo box) and cboNames(combo box).

There are the letters from A to Z in cboSearch.
When I choose B from cboSearch, I want to show the names in cboNames which starts B.

Advise me,pls.
Posted
Updated 10-Nov-10 21:45pm
v2
Comments
Dalek Dave 11-Nov-10 3:45am    
Edited for Readability.

1 solution

In the SelectedIndexChanged event handler of cboSearch, just clear cboNames and fill only the names with the according starting letter in there.

You can get the selected letter with (string)(cboSearch.SelectedItem)
 
Share this answer
 
Comments
Htike Htike Aung 11-Nov-10 4:04am    
Yeah, I use SelectedIndexChanged event handler.I use list of Sort() because I've already saved some data in List,as well.e.g,
private void cboSearch_SelectedIndexChanged(object sender, EventArgs e)
{
namelist.Sort();
}

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