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. dynamic binding a combo box

dynamic binding a combo box

Scheduled Pinned Locked Moved Visual Basic
wpfwcftutorial
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.
  • A Offline
    A Offline
    abhishk2001 yahoo com
    wrote on last edited by
    #1

    Hi, I have a combobox, for users. It's a lookup, which gets the user names from the table "tblContacts" field "Name". when the form loads, the combobox gets populated. There is also one button to add the user, if the user is not available in the table, and onClick the Add button, which will pop-up one more form, to add the new user. it does fine, adds the user to the table. but it dosen't populate the combobox immediately with the new user just added. when the form loads, i was storing all the values in an Arraylist from the table and specifying the combobox datasource as the Arraylist. can anyone tell me how to dynamically bind the combobox, which will reflect the new records added. Thanx vijay

    M 1 Reply Last reply
    0
    • A abhishk2001 yahoo com

      Hi, I have a combobox, for users. It's a lookup, which gets the user names from the table "tblContacts" field "Name". when the form loads, the combobox gets populated. There is also one button to add the user, if the user is not available in the table, and onClick the Add button, which will pop-up one more form, to add the new user. it does fine, adds the user to the table. but it dosen't populate the combobox immediately with the new user just added. when the form loads, i was storing all the values in an Arraylist from the table and specifying the combobox datasource as the Arraylist. can anyone tell me how to dynamically bind the combobox, which will reflect the new records added. Thanx vijay

      M Offline
      M Offline
      mythinky
      wrote on last edited by
      #2

      That's is because you combo box's data source is set to ArrayList that is not updated when you add new user. The new user is added to the table without syncronizing the ArrayList. Try to replace all the values in the ArrrayList with the table when there is new user added. I am not expert. I am just a beginner. Learning .NET

      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