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. TreeView customization

TreeView customization

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

    Is there a way to change the default node class type used by a TreeView control? I would like the TreeView to operate normally, but instead of creating TreeViewNode objects, to create MyTreeViewNode objects. I would like the node to expose an additional attribute. class MyTreeViewNode: TreeViewNode { public string ExtendedProperty { get { } } }

    L D 2 Replies Last reply
    0
    • A astibich2

      Is there a way to change the default node class type used by a TreeView control? I would like the TreeView to operate normally, but instead of creating TreeViewNode objects, to create MyTreeViewNode objects. I would like the node to expose an additional attribute. class MyTreeViewNode: TreeViewNode { public string ExtendedProperty { get { } } }

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

      astibich2 wrote:

      Is there a way to change the default node class type used by a TreeView control?

      If I remember correctly, the answer is NO.

      xacc.ide - now with TabsToSpaces support
      IronScheme - 1.0 beta 1 - out now!
      ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))

      1 Reply Last reply
      0
      • A astibich2

        Is there a way to change the default node class type used by a TreeView control? I would like the TreeView to operate normally, but instead of creating TreeViewNode objects, to create MyTreeViewNode objects. I would like the node to expose an additional attribute. class MyTreeViewNode: TreeViewNode { public string ExtendedProperty { get { } } }

        D Offline
        D Offline
        DaveyM69
        wrote on last edited by
        #3

        You'll need to create your own MyTreeView that takes your TreeNode Type in place of the System.Windows.Forms one by creating the new properties and methods you need and hiding the old ones, as well as creating MyTreeNodeCollection etc... Then you can just use your MyTreeview instead.

        Dave
        BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
        Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)

        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