Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / April 2006

Tip: Looking for answers? Try searching our database.

Combo Box

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DK - 03 Apr 2006 06:23 GMT
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.
Otis Mukinfus - 03 Apr 2006 12:17 GMT
>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
DK - 04 Apr 2006 06:32 GMT
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").

> >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
[quoted text clipped - 8 lines]
> http://www.arltex.com
> http://www.tomchilders.com
Otis Mukinfus - 04 Apr 2006 13:06 GMT
>Thanks for that.
>Once a Combobox is bound to a dataset, adding items through
[quoted text clipped - 13 lines]
>> 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
Claes Bergefall - 04 Apr 2006 18:26 GMT
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

>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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.