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. Databinding

Databinding

Scheduled Pinned Locked Moved C#
tutorial
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.
  • A Offline
    A Offline
    Anonymous
    wrote on last edited by
    #1

    Hi what I want to know if it is possible to bind a property of a property to for example a listbox. When I try it comes up with a lot of strange errors. First it tried to show the ValueMember and then it used the qualified name. The code: MyListBox.DataSource = MyObject MyListBox.ValueMember = "ID" //Property of MyObject MyListBox.DisplayMember = "SubObject.Name" //Property of SubObject

    U 1 Reply Last reply
    0
    • A Anonymous

      Hi what I want to know if it is possible to bind a property of a property to for example a listbox. When I try it comes up with a lot of strange errors. First it tried to show the ValueMember and then it used the qualified name. The code: MyListBox.DataSource = MyObject MyListBox.ValueMember = "ID" //Property of MyObject MyListBox.DisplayMember = "SubObject.Name" //Property of SubObject

      U Offline
      U Offline
      User 1045581
      wrote on last edited by
      #2

      DisplayMember will take the SQL field name. I think you cannot assign field name "SubObject.Name" like this. Anil Joshi

      A 1 Reply Last reply
      0
      • U User 1045581

        DisplayMember will take the SQL field name. I think you cannot assign field name "SubObject.Name" like this. Anil Joshi

        A Offline
        A Offline
        Anonymous
        wrote on last edited by
        #3

        This has nothing to do with SQL. The data is coming from a Xml-File. But that is not the point. What MyListBox.ValueMember = "ID" does is bind it with a Property in the already bound MyObject. So the question remains is it possible to use a property of a property as a DisplayMember? /Johan

        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