Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HELP WITH COMBOBOX

Status
Not open for further replies.

BFT1303

Programmer
Jan 26, 2007
29
US
I am trying to empty all items from my ComboBox. I cant seem to clear the list.
I am filling the box from an ArrayList of strings. This is running on Windows CE 5.0 and written in C#.

Can you please point me in the right direction?

Thank you.
 
can you post some code as to how you are populating the combobox?

Are you databinding it? If so try setting the DataSource = null
 
To remove all items from Combo or Array List. Wwhich list are you removing items from?

Code:
 // Add 2 Items to array list
 arrayList.Add("Item 1");
 arrayList.Add("Item 2");

 remove 2 items
 arrayList.RemoveRange(0, arrayList.Count);
 
 // remove all from combo
 CmbList.Items.Clear();

 // you could also rebind to the empty arrayList (i think)

Is this what you are trying to do? NOT TESTED!

Age is a consequence of experience
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top