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. Additional text into bound combobox.

Additional text into bound combobox.

Scheduled Pinned Locked Moved Visual Basic
tutorialquestion
4 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.
  • U Offline
    U Offline
    udikantz
    wrote on last edited by
    #1

    hello , i am using a combobox which is bound to a dataset with a bindingsource i have set the displayMember to one of the dataset columns , what i want to do is add some additional text to the elements displayed text in the combobox , for example to the first element i would like to add '1' and to the 2nd element '2' .... any idea how i might do that ? thank you very much in advance!

    Net

    M 1 Reply Last reply
    0
    • U udikantz

      hello , i am using a combobox which is bound to a dataset with a bindingsource i have set the displayMember to one of the dataset columns , what i want to do is add some additional text to the elements displayed text in the combobox , for example to the first element i would like to add '1' and to the 2nd element '2' .... any idea how i might do that ? thank you very much in advance!

      Net

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      Add the information into the dataset before binding. You cannot do this via the combo, you need to manipulate the underlying data.

      Never underestimate the power of human stupidity RAH

      U 1 Reply Last reply
      0
      • M Mycroft Holmes

        Add the information into the dataset before binding. You cannot do this via the combo, you need to manipulate the underlying data.

        Never underestimate the power of human stupidity RAH

        U Offline
        U Offline
        udikantz
        wrote on last edited by
        #3

        there is no toString() method that i could override to get that results? , altering the data seems a bit extreme for this task and the problem is the selected element in the combobox is also bound to some other text box that i would like to stay as it is.

        Net

        M 1 Reply Last reply
        0
        • U udikantz

          there is no toString() method that i could override to get that results? , altering the data seems a bit extreme for this task and the problem is the selected element in the combobox is also bound to some other text box that i would like to stay as it is.

          Net

          M Offline
          M Offline
          Mycroft Holmes
          wrote on last edited by
          #4

          You're problem is that the combo does not control the data, that is completely at the mercy of the underlying dataset. You could add another field to the dataset purely for combo display, bind the display member to the combo field and the textbox the the original field. What you are not going to be able to do is fiddle with the data via the combo control.

          Never underestimate the power of human stupidity RAH

          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