Combo Box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a ComboBox bound to a dataset. I want to add an Item "<Select an
Entry>" to the combo box. It is in addition to the items already added to the
control through the Dataset (From DB). How it can be done?

Thanks.
 
Thanks for that.
Once a Combobox is bound to a dataset, adding items through
ComboBox.Items.Insert(0, "First Entry") raises exception ("Items collection
cannot be modified when the DataSource property is set").

Otis Mukinfus said:
I have a ComboBox bound to a dataset. I want to add an Item "<Select an
Entry>" to the combo box. It is in addition to the items already added to the
control through the Dataset (From DB). How it can be done?

Thanks.

After binding the combobox add your entry at item[0].
Good luck with your project,

Otis Mukinfus
http://www.arltex.com
http://www.tomchilders.com
 
Thanks for that.
Once a Combobox is bound to a dataset, adding items through
ComboBox.Items.Insert(0, "First Entry") raises exception ("Items collection
cannot be modified when the DataSource property is set").

Otis Mukinfus said:
I have a ComboBox bound to a dataset. I want to add an Item "<Select an
Entry>" to the combo box. It is in addition to the items already added to the
control through the Dataset (From DB). How it can be done?

Thanks.

After binding the combobox add your entry at item[0].
Good luck with your project,

Otis Mukinfus
http://www.arltex.com
http://www.tomchilders.com

Well I'll be darned!

I never bind data to ComboBoxes used for lookup lists. That's another good
reason for not doing it.

Good luck with your project,

Otis Mukinfus
http://www.arltex.com
http://www.tomchilders.com
 
You need to add it to your dataset (or rather to the contained datatable)
after you have filled it with data from your db but before binding the
combobox to it.


/claes
 
Back
Top