treenode

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...

TreeNodeCollection reference problem

First off we have the almighty code! List nodes = new List(); TreeNode Temp = new TreeNode(); TreeNodeCollection nodeList = treeViewTab4DirectoryTree.Nodes; while (nodeList.Count != 0) { Temp = nodeList[0]; while (Temp.FirstNode != null) { Temp = Temp.FirstNode; } if (!nodes.Contains(Temp.FullPath)) {...

Algorithm to calculate the most energy efficient ad-hoc network

Hi, I have a (theoretical) network with N nodes, each with their own fixed location. Each node sends one message per cycle, which needs to reach the root either directly or via other nodes. The energy cost of sending a message from node A to node B is the distance between them, squared. The challenge is how to link these nodes, in a ...

crash in the handler that moves up a treenode in a treeview c#

i have a event handler that moves the selected treenode up. I don't know why is crash in the line with comented. treeviewdocxml is a treeview object, from System.Windows.Forms treeViewDocXml.BeginUpdate(); TreeNode sourceNode = treeViewDocXml.SelectedNode; if (sourceNode.Parent == null) { ret...

Label field problem in the treenode Tag. (Struts2/Ajax)

I'm using struts as a framework for a web-app. The following code runs inside a loop where I access the database to retrieve values to be used as nodes for a tree. <s:set name="categoryValue" value= "%{'<%=rs.getString("category")%>'}"> </s:set> <sx:treenode id="child1" label ="%{#categoryValue}"/> The error I get is "/jsp/tree.j...

How to use dojo-tree node in php query

Hi, could someone explain how it is possible to extract a node label (instead of a value) from a dojo-tree and than use it in a (php) query? Thank you! ...

Accessing object properties from a treenode that's associated with it ?

Hallo, I have read http://stackoverflow.com/questions/1880930/easy-object-binding-to-treeview-node, but still have unanswered question. if an object is associated with treenode tag property, how to access that object members/properties from that treenode ? node1 = new TreeNode(); node1.tag = object1; //ex:if object1 has public prope...

TreeNodes don't get collected with weakevent solution

Hi, When I use this method http://stackoverflow.com/questions/1089309/weak-events-in-net (by Egor) to hook up a event i a inherited treenode, the tree node never gets collected, is there any speciall case with tree nodes and GC? public class MyTreeNode : TreeNode { public MyTreeNode(Entity entity) { entity.Children.ListC...

NavigateUrl is not working with SelectedNodeStyle

I'm trying to get SelectedNodeStyle to work with NavigateUrl without success. The style is not applied when clicking on nodes. <asp:TreeView ID="treeviewSIP" runat="server" ExpandDepth="0"> <SelectedNodeStyle BackColor="Red" ForeColor="WhiteSmoke" BorderStyle="Solid" BorderWidth="1px" Bor...

Treenode Duplicate when expanded from collapse

Items in the child node seem to replicate themselves everytime when expanded from a collapsed state. I think the problem is that the memory needs to be cleared before I expand. Can anyone see why this event would occur. Thanks in Advance. Public Sub FillTree(ByVal s As String) Dim nodeText As String = "" Dim sb As New ...

How can I make a TreeNode change the cursor when the mouse hovers over it?

I have created a menu using a treeview to launch forms when the user clicks on a node. To complete the look-and-feel, I have set up the nodes to look like hyperlinks. I'd like to have the cursor change to a hand (like the one you see when you hover over a link) when the user hovers over a node, however so far I've only been able to hav...

Expanding Wickets TreeTable nodes when initializing a tree

I'm pretty new to wicket and I'm trying to create a simple wicket tree that holds information about mailinglists. This mailinglist is related to a certain letter. MailingListDto 1 User 1 User 2 MailingListDto 2 User 3 User 4 If we are editing an existing letter, the mailinglists related to that letter are fetched into mailingList...

Changing TreeNode.BackColor causes full TreeView redraw

I set the BackColor of specific TreeNodes in a TreeView as a hint to the user that something interesting has happened to the node while they are using the application. However, when I set BackColor, it causes the entire parent TreeView control to redraw rather than just the label area of the specific TreeNode that has been changed. I a...

How do I make a Control follow its parent in a scrolling TreeView?

I've got a TreeView with a bunch of child nodes in it, all of which have child nodes of their own. A user asked me to provide auto-completion when editing any of the "grandchild" TreeNodes, so I had to implement a floating TextBox that sits directly over the TreeNode. Problem is, if the user scrolls the TreeView with her middle mouse b...

asp.net: Button changes TreeView.Selected node to null

It seems that as soon as I click the button the treeview changes selected node to null. Is it because cliking on anything else unselets the node? how can I make the value persist so that I can use it inside the button click event? button click protected void Button1_Click(object sender, EventArgs e) { TextBox1.Text = "-----...

How do you cut, copy, and paste an extended Tree Node?

I have a c# project using version 4.0 of the .net framework, and running on VS 2010. I have created a tree view populated with some extended tree nodes. I want the user to be able to copy, cut, and paste these nodes to the clipboard via a context menu or keyboard shortcuts (and not just drag-drop). The code runs fine when copying, but w...

Slow TreeNode with CheckBoxes [large quantity]

Tree View control's AfterCheck event checks all child nodes below it and enables the Run button if something is checked. 1346 void TreeNode_AfterCheck(object sender, TreeViewEventArgs e) { 1347 if (!e.Node.Checked) return; 1348 foreach (TreeNode sub in e.Node.Nodes) { 1349 sub.Checked = e.Node.Checked; 1350 } 1351 RunButton....

Get the state of a TreeView after node population (ASP.NET 3.5)

Basically what I'm trying to do is get the previous state of a treeview and compare it with a changed state of the same treeview. This is so I can make changes to the database based on the changed treeview. I've tried to capture the TreeView on the PreRender event, but it seems that the TreeNodePopulate event comes after that. The Tree...

NSTreeNode parentNode method never returns nil

Hello, I am using bindings with a NSOutlineView and NSTreeController. I am trying to determine the parent node of a particular node by using the -parentNode method of NSTreeNode, however the method never returns nil as indicated in the documentation. Instead I have to do this in order to make things work. The introspection is a hack. Any...

[jQuery] NOD name for VALUE?

Hey. I've a few inputs and I want to clear their values after clicking. How to? <input type="text" value="Name" /> I've tried: $(this).inputValue(""); But it doesn't work. If I'm unable to change the value, how to add text to the input ($(this).text(""); works very well in, for example, textareas). Thanks! ...