checked treeview question

Hello!

I created a CheckedTreeView. It has several categories, but only the nodes at the lowest should have a checkbox. all the parent-items should just show a symbol.

Is this possible


Answer this question

checked treeview question

  • marc lena

    the windows treeview node has the stateimageindex and the stateimagekey properties already there for you...all you have to do is setup an image list with your images and assign them accordingly to each node

  • Dave Comer

    I think, what you just told me is for a System.Web.TreeView

    But I have a System.WIndows.Forms.TreeView.

    There are no such methods.

  • spoon16

    Well, ok. It shows images. But also the Checkbox next to each item.

    Have I done anything wrong

  • Alio

    As of v2.0 yes. The TreeView.ShowCheckBoxes property can be used to control groups of nodes. You can then use TreeNode.ShowCheckBox to control individual nodes. Thus if you set the TreeView to TreeNodeTypes.Leaf then all leaf nodes would have a check box. However if you also wanted their parents to have a check box then you could enumerate the leafs and set each parent TreeNode's property to true.

    Prior to v2.0 then you basically have to manage the state of the nodes yourself using a state image list with the various check box states in it. Not pretty but back in the early Win32 days that is how it was done.

    Michael Taylor - 6/21/06


  • checked treeview question