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. C#
  4. How to add additional text to a bound combobox

How to add additional text to a bound combobox

Scheduled Pinned Locked Moved C#
tutorialquestion
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.
  • 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

    P 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

      P Offline
      P Offline
      priyareguri
      wrote on last edited by
      #2

      hi friend... i got one solution dt... dn't set displymember and datasouceid property... just fill adapter and dataset... code:. Adapter.Fill(datset.xyztable); for(int i=0;i<datset.xyztable.rows.count;i++)> { combobox1.Items.Add(i+"-"+datset.xyztable.Rows[i]["columnname"].Tostring()); }

      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