How to clean all itens in a Combobox list???

T

Thomaz

Hi i need some help to solve a problem with the DataSource
in a COMBOBOX.
The question is "How can i clear all the itens in a
Combobox if i use the DataSource to browse data in a
database????".
I use the code below to fill a combobox:

this.cboSubfamilia.DataSource = thisDataSet.Tables
["subfamilia"];
this.cboSubfamilia.DisplayMember = "subfamilia";

After to make the described one above, as I can clean all
itens of same combobox and does not appear nothing in its
listing???
 
N

Nicholas Paldino [.NET/C# MVP]

Thomaz,

You should be able to remove the data source and it should remove the
items from the combobox.

Hope this helps.
 
N

NULL

Thomaz,

You should be able to remove the data source and it should remove the
items from the combobox.

TO be sure, you can always:
myComboBox.Items.Clear();
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top