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. combobox.DataSource VS DataGrid.DataSource

combobox.DataSource VS DataGrid.DataSource

Scheduled Pinned Locked Moved C#
helpcsharpvisual-studioquestion
3 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.
  • V Offline
    V Offline
    V 0
    wrote on last edited by
    #1

    What's the difference between a combobox.DataSource and a DataGrid.DataSource? If I do this in my code: mycombobox.DataSource = dbconn.GetDataSet().Tables[0].DefaultView; mydatagrid.DataSource = dbconn.GetDataSet().Tables[0].DefaultView; the datagrid gets filled with the correct values, the combobox with "System.Data.DataRowView" items. In .Net 1.1 however this problem didn't occurred, or did it? tnx for your help. Coulda, woulda, shoulda doesn't matter if you don't. :jig: :jig: :jig: :jig: :jig: :jig: :jig: :jig: :jig: :jig: :jig:

    T 1 Reply Last reply
    0
    • V V 0

      What's the difference between a combobox.DataSource and a DataGrid.DataSource? If I do this in my code: mycombobox.DataSource = dbconn.GetDataSet().Tables[0].DefaultView; mydatagrid.DataSource = dbconn.GetDataSet().Tables[0].DefaultView; the datagrid gets filled with the correct values, the combobox with "System.Data.DataRowView" items. In .Net 1.1 however this problem didn't occurred, or did it? tnx for your help. Coulda, woulda, shoulda doesn't matter if you don't. :jig: :jig: :jig: :jig: :jig: :jig: :jig: :jig: :jig: :jig: :jig:

      T Offline
      T Offline
      therealmccoy
      wrote on last edited by
      #2

      Dunno about .Net 1.1, but I just ran across this issue as well. I used the DisplayMember property (in conjunction with DataSource) to properly display the value in a ComboBox/ListBox control. Otherwise I just saw the name of the object. www.lovethosetrains.com

      V 1 Reply Last reply
      0
      • T therealmccoy

        Dunno about .Net 1.1, but I just ran across this issue as well. I used the DisplayMember property (in conjunction with DataSource) to properly display the value in a ComboBox/ListBox control. Otherwise I just saw the name of the object. www.lovethosetrains.com

        V Offline
        V Offline
        V 0
        wrote on last edited by
        #3

        And idd it works !! It does seem logical, but why don't they put that kind of info in MSDN :confused:. tnx :-D Coulda, woulda, shoulda doesn't matter if you don't. :jig: :jig: :jig: :jig: :jig: :jig: :jig: :jig: :jig: :jig: :jig:

        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