Where is the asp:TreeNode control in the toolbox

T

Tony Johansson

Hello!

When I look in the toolbox I can't find the TreeNode. but the TreeView
control is there
Is it meant that I should enter the TreeNode control by hand.
I have looked everywhere in the Toolbox but no TreeNode control.

//Tony
 
J

Jeff Johnson

When I look in the toolbox I can't find the TreeNode. but the TreeView
control is there
Is it meant that I should enter the TreeNode control by hand.
I have looked everywhere in the Toolbox but no TreeNode control.

The toolbox only contains "standalone" controls. A tree node must belong to
a tree view, so it isn't standalone, and therefore you won't find it in the
toolbox. What in the world are you trying to do that you think you need to
put a tree node directly on a form?
 
T

Tony Johansson

Jeff Johnson said:
The toolbox only contains "standalone" controls. A tree node must belong
to a tree view, so it isn't standalone, and therefore you won't find it in
the toolbox. What in the world are you trying to do that you think you
need to put a tree node directly on a form?
I do know that a TreeNode must belong to a TreeView but I just thought that
when a TreeView exist then a TreeNode would also exist.

//Tony
 
J

Jeff Johnson

I do know that a TreeNode must belong to a TreeView but I just thought
that when a TreeView exist then a TreeNode would also exist.

If you were hoping to drop a tree view onto a page and then start dragging
tree nodes onto it, it just doesn't work that way. However, the TreeView
control has an Edit Node command which brings up a dialog to declare nodes
at design time if you don't want to write code.

Here's a hint for determining whether or not something ought to appear in
the toolbox or not: look at its inheritance hierarchy. If one of the class's
ancestors doesn't have "control" or "component" somewhere in its name, you
almost certainly won't find it in the toolbox.

TreeView looks like this:

public class TreeView : HierarchicalDataBoundControl, IPostBackEventHandler,
IPostBackDataHandler, ICallbackEventHandler

TreeNode like this:

public class TreeNode : IStateManager, ICloneable
 
T

Tony Johansson

Jeff Johnson said:
If you were hoping to drop a tree view onto a page and then start dragging
tree nodes onto it, it just doesn't work that way. However, the TreeView
control has an Edit Node command which brings up a dialog to declare nodes
at design time if you don't want to write code.

Here's a hint for determining whether or not something ought to appear in
the toolbox or not: look at its inheritance hierarchy. If one of the
class's ancestors doesn't have "control" or "component" somewhere in its
name, you almost certainly won't find it in the toolbox.

TreeView looks like this:

public class TreeView : HierarchicalDataBoundControl,
IPostBackEventHandler, IPostBackDataHandler, ICallbackEventHandler

TreeNode like this:

public class TreeNode : IStateManager, ICloneable

Good explained Jeff

//Tony
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top