Add ComboBox Item after loading from query...

cboshdave

Member
Joined
Dec 11, 2014
Messages
24
Programming Experience
1-3
I have loaded a comboBox with items from a query. It works well.
I need to add another item after loading from a query. It is an item that I don't want in the table.
Is this possible?

C#:
comboBox.ValueMember = "NetPK";
comboBox.DisplayMember = "NetName";
comboBox.DataSource = dt;
DB.CloseConnection();

So now the combobox is loaded, but I want to add the Value of "Blank" to the list.

I can't seem to find out how to accomplish this.
 
It's not possible to mix and match items. They have to either all be added directly or all be in the data source. You will have to:

1. add the extra item to the data source; or
2. copy the data from the current data source to another list, add the extra item to that list and use that list as the data source; or
3. don't bind the control and add all the items you need directly.
 

Latest posts

Back
Top Bottom