Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Adding Items to data-bound Combo Box

Adding Items to data-bound Combo Box

Scheduled Pinned Locked Moved Visual Basic
help
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Raabi Anony
    wrote on last edited by
    #1

    Hello! In my data entry form, all the fields are bound to a tblStaff table through BindingSource (staffInfoBS). One of these controls is a cboGender ComboBox. I want to manually populate the cboGender with only two items -- "Male" and "Female" and the SelectedValue be saved in the underlying table. If I try to use something like Items.Insert, I receive error: Items collection cannot be modified when the DataSource property is set. How can get it done. Please suggest.

    D 1 Reply Last reply
    0
    • R Raabi Anony

      Hello! In my data entry form, all the fields are bound to a tblStaff table through BindingSource (staffInfoBS). One of these controls is a cboGender ComboBox. I want to manually populate the cboGender with only two items -- "Male" and "Female" and the SelectedValue be saved in the underlying table. If I try to use something like Items.Insert, I receive error: Items collection cannot be modified when the DataSource property is set. How can get it done. Please suggest.

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      You either have to have items in the datasource that your combo seems to be bound to or you have to scrap the binding on the combo and put the items in yourself. You can't have both.

      A guide to posting questions on CodeProject

      Click this: Asking questions is a skill. Seriously, do it.
      Dave Kreskowiak

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups