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. Dropdown list in windows forms

Dropdown list in windows forms

Scheduled Pinned Locked Moved C#
asp-netdatabasewinformshelpannouncement
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.
  • K Offline
    K Offline
    krishna19
    wrote on last edited by
    #1

    Hi, I am new to windows forms prog. I want to use a drop down list in windows form like they do in web forms. I tried combobox and set its dropdown style to drop down list but when i try to bind data to it from a database by setting its datasource as ad dataset, i am seeing only this in the combo box. System.Data.DataViewMember. Please help...

    If you fail for the first time , call it version 1.0.

    M 1 Reply Last reply
    0
    • K krishna19

      Hi, I am new to windows forms prog. I want to use a drop down list in windows form like they do in web forms. I tried combobox and set its dropdown style to drop down list but when i try to bind data to it from a database by setting its datasource as ad dataset, i am seeing only this in the combo box. System.Data.DataViewMember. Please help...

      If you fail for the first time , call it version 1.0.

      M Offline
      M Offline
      Mandaar Kulkarni
      wrote on last edited by
      #2

      It is fine upto setting the datasource of the combo box. But Just by setting datasource, the combo doesnot understand which field of the table to be displayed. For that you have to set the DisplayMember property. The displaymember property will contain all the coulmn names of the table you have retrived in the dataset. If you want to display some property (e.g. Name) and internally use another property (e.g ID) then you can set ValueMember property as follows DisplayMember=Name; ValueMember=ID; Hope this helps. :)

      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