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. Need help with PropertyGrid

Need help with PropertyGrid

Scheduled Pinned Locked Moved C#
helpdata-structurestutorial
3 Posts 3 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.
  • T Offline
    T Offline
    TheSnakeByte
    wrote on last edited by
    #1

    Now, I just recently found out about PropertyGrid and I think I like it. My problem is, I can't figure out how to display my tree in a apropriate way. My classes look like this: class MyTreeNode { List mylist = new List(); public MyTreeNode[] SubNodes { get { return (MyTreeNode[])mylist.ToArray(); } } public string Name = "something"; } I want this MyTreeNode class to display as a list of nodes; but instead of that [0] as a name it should display the node's Name-attribute. I would also like to set the value to something different. I just can't figure out how to do that exactly. please give me a hint. so long.

    S L 2 Replies Last reply
    0
    • T TheSnakeByte

      Now, I just recently found out about PropertyGrid and I think I like it. My problem is, I can't figure out how to display my tree in a apropriate way. My classes look like this: class MyTreeNode { List mylist = new List(); public MyTreeNode[] SubNodes { get { return (MyTreeNode[])mylist.ToArray(); } } public string Name = "something"; } I want this MyTreeNode class to display as a list of nodes; but instead of that [0] as a name it should display the node's Name-attribute. I would also like to set the value to something different. I just can't figure out how to do that exactly. please give me a hint. so long.

      S Offline
      S Offline
      SeMartens
      wrote on last edited by
      #2

      Hi, I don't know if this works, but what about overriding the ToString() method. This overridden method should return the name. Maybe this will display the name attribute. Regards Sebastian

      1 Reply Last reply
      0
      • T TheSnakeByte

        Now, I just recently found out about PropertyGrid and I think I like it. My problem is, I can't figure out how to display my tree in a apropriate way. My classes look like this: class MyTreeNode { List mylist = new List(); public MyTreeNode[] SubNodes { get { return (MyTreeNode[])mylist.ToArray(); } } public string Name = "something"; } I want this MyTreeNode class to display as a list of nodes; but instead of that [0] as a name it should display the node's Name-attribute. I would also like to set the value to something different. I just can't figure out how to do that exactly. please give me a hint. so long.

        L Offline
        L Offline
        leppie
        wrote on last edited by
        #3

        Apply the ExpandableTypeConvertor as the TypeConvertor for that property. xacc-ide 0.0.15 now with C#, MSIL, C, XML, ASP.NET, Nemerle, MyXaml and HLSL coloring - Screenshots

        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