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. Windows Forms
  4. combobox (common controls) data display

combobox (common controls) data display

Scheduled Pinned Locked Moved Windows Forms
helplounge
1 Posts 1 Posters 3 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.
  • I Offline
    I Offline
    imanzi
    wrote on last edited by
    #1

    I've just met the Common Controls combobox and it is starting off like an awkward blind date. My issue is that when the record/row changes in the underlying dataset,the combobox's Text property only properly updates and displays (DisplayMember text) when the ValueMember(key value) changes. If the record/row changes and the ValueMember value remains the same, then the combobox Text displays the ValueMember value rather than the DisplayMember text. I've massacred the terminology here and I apologize, but I'm hoping the general problem gets through and that before I apply the workaround plasters, there is a simple, conventional solution I'm missing. Here is the combobox code:

    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
    Me.TblLocationTableAdapter.Fill(Me.DbPropertiesBEDataSet.tblLocation)

        With LOCATIONIDComboBox
            .DataBindings.Add("SelectedValue", Me.TblPropertiesBindingSource, "LocationID")
            .DataSource = DbPropertiesBEDataSet.tblLocation
            .ValueMember = "LocationID"  'primary key           
            .DisplayMember = "LocDesc"	'related text
    
        End With
    
    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