Can Anyone add control in TreeView Control?
Hey all .net programmers..
I am thinking about Tree View control which contains controls. any idea?
Microsoft Tree View control only support add nodes as text. i think. but istead of text, putting Button or link or any usercontrol.. what do u think?
You can customize the treeview by overriding the behavior of each node (to add additional properties, for example) or render it in a certain way, such as the Outlook 2003 Folders treeview. It's highly extensible: you could add all sorts of 'objects' to a node.
I'm not sure what you are really asking: can you do it (add user controls)? I'm sure you could. Should you do it? I don't know - sounds like an end user nightmare. A link or a button could be rendered in a node if that's what you want. Suck it and see, that's what I say :)
What you're trying to do is not possible with the builtin TreeView in System.Windows.Forms. The TreeNodes while having a great deal of customization are still essentially drawn by the TreeView control itself.
I'm sure this restriction stems in some way from the TreeView being a very thin wrapper around the Win32 tree view control.