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
5
votes
1 answer

Extract the hierarchical structure of the nodes in a dendrogram or cluster

I would like to extract the hierarchical structure of the nodes of a dendrogram or cluster. For example in the next example: library(dendextend) dend15 <- c(1:5) %>% dist %>% hclust(method = "average") %>% as.dendrogram dend15 %>% plot The nodes…
Ruben
  • 493
  • 4
  • 18
5
votes
5 answers

Find the maximum depth of a tree

I have a tree data structure with N first-level child nodes that have childs too. For example: Root Node1 Node11 Node111 Node1111 Node12 Node2 Node21 Node211 I would like to know which of the braches has the biggest depth. As in the…
Vincenzo
  • 61
  • 1
  • 1
  • 3
5
votes
3 answers

how to go from TreeNode.FullPath data and get the actual treenode?

I would like to store some data from TreeNode.FullPath and then later i would like to re-expand everything up to that point. Is there a simple way of doing it? Thanks a lot!
FurtiveFelon
  • 14,714
  • 27
  • 76
  • 97
5
votes
1 answer

ExtJS 4 - Never cache tree nodes in tree panel

I have a simple Ext.tree.Panel, which loads its data from a Ext.data.TreeStore using an ajax proxy. The default behavior when expanding a treenode seems to be: if expanded before: retrieve from cache if never expanded: retrieve from server How can…
Zurb
  • 738
  • 1
  • 5
  • 18
5
votes
3 answers

Node is partially cut off in winform TreeView

I am having issues figuring out what this issue is. I have googled around and have not found many solutions to this issue. The only "solution" I found was a hack to expand then collapse the last node. this.Nodes[this.Nodes.Count -…
Smeiff
  • 259
  • 1
  • 6
  • 17
4
votes
3 answers

Prevent drag and drop outside of the current control (TreeNodes in a TreeView)

I'm maintaining a Windows app that has multiple forms in the one window (form1, form2, form3). I'm treating the other form2 and form3 as black boxes at the moment. In form1 I have a TreeView, and I'm implementing drag and drop functionality within…
MattyG
  • 8,449
  • 6
  • 44
  • 48
4
votes
1 answer

Clarity + Angular6: Tree View Node Listener (clr-tree-node)

I'm trying to track changes made to the tree nodes data source. Each node has a selected property which reflects the node selection status, every time I select a node, I need to emit the selection to another component, which will build another tree…
Alex
  • 127
  • 7
4
votes
1 answer

Double-click beavior on a TreeNode checkbox

I have a TreeView populated with TreeNodes having icons and checkboxes. I've been tryig to disable the checkig/unchecking ability of some of them discarding the event in the BerforeCheck method. This works fine, until I double click on the checkbox:…
gregseth
  • 12,952
  • 15
  • 63
  • 96
4
votes
1 answer

Populating a treeview with files in ASP.NET C#

I have a treeview that I am trying to populate with folders and files. The treeview is populating the folders just fine but not the files. Here is my code: protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) …
nate
  • 1,418
  • 5
  • 34
  • 73
4
votes
1 answer

F# Tree: Node Insertion

This is a question that extends F# Recursive Tree Validation, which I had nicely answered yesterday. This question concerns inserting a child in an existing tree. This is the updated type I'd like to use: type Name = string type BirthYear …
Simon Emil
  • 85
  • 4
4
votes
1 answer

Fancytree not expand node after reload

I'm working with fancytree. How can open a node (lazy) after it was reload in javascript? Code: node.load(forceReload = true); node.setExpanded(); When execute node.setExpanded() I get "Assertion failed" error. I think that the problem is…
4
votes
1 answer

JTree Edit Root Node?

I am trying to create a JTree I can edit later. So far I have the following code which generates the tree with root node as expected. But, when the button is clicked (triggering the action listener) it adds another node under the root node. What I…
Kyle
  • 2,339
  • 10
  • 33
  • 67
4
votes
1 answer

Java algorithm to compare trees for subtrees

I'm looking for an algorithm to compare two trees to each other and check if the on tree is a subtree of the other. I first provided an own tree implementaion, which has the following structure: public class PlatformTree { private HwNode root; …
ph09
  • 1,052
  • 2
  • 20
  • 31
4
votes
1 answer

Implementing IEnumerable on a tree structure

Based on the work of these guys: http://dvanderboom.wordpress.com/2008/03/15/treet-implementing-a-non-binary-tree-in-c/ http://www.matthidinger.com/archive/2009/02/08/asp.net-mvc-recursive-treeview-helper.aspx I am trying to implement a TreeView…
krisg
  • 796
  • 1
  • 9
  • 24
4
votes
4 answers

Delimiter-separated string to TreeView C#

I have an input stream something like this: John Peter Vanesa Vanesa.New Josh Josh.New Josh.New.Under ... I need to Add Nodes to TreeView Someting like this: +Customers +John +Peter +Vanesa +New +Josh +New +Under …
Emo
  • 75
  • 1
  • 5
1 2
3
41 42