Questions tagged [treenode]

The base element of a hierarchical tree-like data structure.

Trees are hierarchical data structures that represent undirected acyclic graphs. A tree is therefore composed of connected nodes.

One specific node is the root of the tree. The root node is connected to several nodes (sometimes called children), each of these being the root of a subtree, and so-on. A node of a tree that does not have any children is called a leaf. All nodes of the tree are connected directly or indirectly to the root.

Treenodes are usually recursive datastructures.

See also:

Specific usages:

  • In .Net framework a TreeNode is a node in TreeView UI control that displays tree-like objects.
  • In Java a TreeNode is an interface that nodes of a JTree UI control that displays tree-like objects.
630 questions
4
votes
1 answer

Root node of TreeView gets copied

I have the following problem. I'm going through a TreeView to fill an XML-tree with the items that are checked in my TreeView. Basically everything works fine, except that every time I finish filling the XML-tree, I get a copy of my…
korguell
  • 554
  • 6
  • 11
4
votes
1 answer

ExtJS4: Find DOM element of tree node

I want to run automated UI tests in my ExtJS4 application. I don't want to use Siesta, the Testing Tool from Sencha. Instead, I want to use a custom tool. The application uses a TreePanel. To support the automated UI test, it is mandatory that each…
n.dee
  • 333
  • 1
  • 3
  • 12
4
votes
2 answers

Word wrap in TreeNode

When inserting a node in TreeView with long text - horizontal scrollbar appears. Is there a way to word wrap the text in TreeNode, instead of scrolling? Currently I use solution that splits the text according to TreeView's width and display its…
nichiporets
  • 431
  • 7
  • 18
4
votes
2 answers

Change mouse cursor on hover over node in JTree

I'm creating a JTree and adding some nodes doing something like this: DefaultMutableTreeNode top = new DefaultMutableTreeNode("The Java Series"); tree = new JTree(top); ... DefaultMutableTreeNode node = new DefaultMutableTreeNode("
Marquinio
  • 4,601
  • 13
  • 45
  • 68
4
votes
1 answer

Why does "appendChild" moves a node?

I'm playing around with native javascript. I'm basically practicing basic node manipulations such -- add, remove, move, copy, and create. While testing move, I got a question. http://jsfiddle.net/sJg7E/ if you look at the jsfiddle above, I've used…
Moon
  • 22,195
  • 68
  • 188
  • 269
4
votes
4 answers

How do I make a TreeNode not visible? (C#)

There is probably a really straightforward answer to this but I'm having difficulty finding it. Simple, I have a TreeNode and I would like to make its visibility false. (or another way of not allowing it to be shown until required). Edit - Another…
Lloyd Powell
  • 18,270
  • 17
  • 87
  • 123
4
votes
1 answer

Why would a TreeView collapse unexpectedly in WinForms?

What would cause a TreeView to collapse, other than a call to the .Collapse() method on a TreeNode or the .CollapseAll() method of the TreeView? In an application that I am developing, the TreeView will simply not behave properly. The TreeView…
James
  • 1,788
  • 4
  • 22
  • 28
4
votes
3 answers

Tree storing multiple values per node

I'm trying to find a way to create a binary tree where 3 doubles are stored in each node and another tree where 6 doubles are stored in each node. The problem I'm having is figuring out a way to implement find and insert methods (no need for …
Joshua Mak
  • 127
  • 3
  • 8
4
votes
1 answer

Creating custom TreeView/TreeNode

I need to extend the TreeNode class such that I can add custom properties to each node (seeing as WebForms TreeNode doesn't include the Tag property). So this is my CustomTreeNode: public class CustomTreeNode : TreeNode { public…
pedroAx
  • 63
  • 1
  • 2
  • 8
3
votes
2 answers

HTML Node Map Generator?

Alright, what I'm looking for is something that could generate a graphical tree-style map of a web pages nodes. So essentially it could theoretically transform something like this:
Wild_Fire126
  • 47
  • 2
  • 7
3
votes
1 answer

How do I get the TreeNode that a context menu is called from?

I have a TreeView control with a bunch of TreeNodes. Each nodes ContextMenu has different MenuItems based on its state. So I am currently attaching each TreeNode its own ContextMenu. TreeView tv = new TreeView(); TreeNode tn = New…
scott
  • 2,991
  • 5
  • 36
  • 47
3
votes
3 answers

Empty expandable treenode in C#

I want to create an expandable empty treenode in C#, i.e. a treenode which is empty and has the [+] sign beside it. The reason is because initially it is empty, but once a node is clicked, I want to populate it with many child nodes. The only…
dnclem
  • 2,818
  • 15
  • 46
  • 64
3
votes
2 answers

Puzzle Solver - TreeNode Help

I'm trying to code a puzzle solver app. I need to find out how many moves it takes, and how many solutions there are. I would rather not give too many details on the puzzle. but the player moves around a grid ( say 5 x 7 ) as they move, obstacles…
Chris Young
  • 684
  • 2
  • 9
  • 23
3
votes
3 answers

ASP.NET: How to Create an Expandable Empty TreeNode

I need to populate the TreeNode.ChildNodes on the event of TreeView.TreeNodeExpanded. The problem is the node is empty before the event gets fired and it is not expandable in this case and there is no expand icon [+] showed next to it. I want to…
Akram Shahda
  • 14,655
  • 4
  • 45
  • 65
3
votes
1 answer

How do I collapse an orgChart with all nodes when first displayed and then show first level of its children by select event?

I create an orgChart by pulling data from json data. at first ı want only show first level of orgChart. ı mean top of chart. and then when ı click the node ı want to list children of clicked node. ı mean showing first degree relative children of…