treenode

ASP.Net TreeView with SiteMap is ignoring Node.Selected

北战南征 提交于 2020-01-14 05:34:46
问题 I create have a TreeView bound to a SiteMap. It works great. <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" /> <asp:TreeView ID="TreeView1" runat="server" DataSourceID="SiteMapDataSource1"> </asp:TreeView> Now I want to change the way the selected node looks. <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" /> <asp:TreeView ID="TreeView1" runat="server" DataSourceID="SiteMapDataSource1"> <NodeStyle ImageUrl="~/Images/Page.png" /> <SelectedNodeStyle ImageUrl="~

windows form treeview with dynamic child

为君一笑 提交于 2020-01-14 03:05:27
问题 I am working on a windows form in C# to build a treeview using data from a database. There is a store procedure which give the list of following info id - node id description - value to be displayed in on the treeview isEndNode - 0 if it is the end node; 1 if this node has child if isEndNode is 1 then I have to call the same store procedure with id of the current node to receive a list of child node under it. I have built a mechanism that will call the store procedure and get the list of

d3.js collapsible force layout with all the nodes collapsed

▼魔方 西西 提交于 2020-01-11 13:41:27
问题 I've been trying to implement a directed force layout using a json file that I've written. Before I tried to make it begin with all nodes collapsed, it was working properly. I've declared a property called "index" for all the nodes, indicating which level of the tree they belong (root's index is 0, it's children are 1, etc.) I'm guessing that there is a problem with "index" property of the nodes because when I first start my page their values are correct, but when I collapse and re-open one a

Why is StateImageIndex on TreeNode limted to a max value of 14?

不打扰是莪最后的温柔 提交于 2020-01-06 16:53:32
问题 Can someone here please explain to me why the StateImageIndex on TreeNode is limited to a maximum value of 14? It doesn't make any sense to me at all. 回答1: See http://msdn.microsoft.com/en-us/library/bb774760(VS.85).aspx http://msdn.microsoft.com/en-us/library/bb775597(VS.85).aspx http://msdn.microsoft.com/en-us/library/bb773409(VS.85).aspx The state images are referred to using a special mask, and it seems to be 4 bits in size, which makes 16 possible values and 0-14 seem to be usable. 来源:

Double-click beavior on a TreeNode checkbox

和自甴很熟 提交于 2020-01-03 15:57:40
问题 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: the image of the checkbox is the opposite of its real state (it shows a check mark if the status is Checked=false ). I've tried to fix that changing the StateImageIndex manually in the NodeDoubleClick and BeforeClick method with no success. Even

Java: How to programmatically select and expand multiple nodes in a JTree?

穿精又带淫゛_ 提交于 2019-12-30 06:05:51
问题 I have a JTree and an awt.Canvas . When i select multiple objects from within the Canvas into the objList , I want all the selected items to be shown inside the JTree as selected. That means for example if I have 2 objects selected, both their paths to root should be expanded, and also each selected object should have its corresponding TreeNode selected. My JTree has TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION . Here is a sample of the expand funcion i use : public void selectTreeNodes()

TreeNode index property by name

淺唱寂寞╮ 提交于 2019-12-25 06:45:38
问题 My question is the following. I need to get the Index of a TreeNode but I know just the name of this Node . Have you any idea, how can I get this property? I'd like something same: int treeIndex = treeView1.Nodes["myNode"].Index; If it's possible please show me a sample code. 回答1: You can do like this, var result = treeView1.Nodes.OfType<TreeNode>() .FirstOrDefault(node => node.Name.Equals("name")); then access the index inside the Result. 回答2: You can define you custom Tree class. Example

Renaming a tree node dynamically outside of contextmenu in jstree

随声附和 提交于 2019-12-24 09:14:04
问题 I use the code below to successfully create a new tree node in jstree outside of contextmenu. My question is how can you dynamically RENAME the text in a tree node in a similar manner outside of the contextmenu? Is there a .jstree("rename" ....) function that can be called to accomplish this? Much appreciated! $("#RequirementsTree").jstree("create", null, "last", {"data" : "new_node_text", "state" : "open", "attr" : { "id" : "new_node_id", "name" : "requirement" }, }); I've tried the

How can set MaxLength for TreeNode Name and text property?

梦想与她 提交于 2019-12-24 07:47:57
问题 How can set MaxLength for TreeNode Name and text property? This is a windows forms application, where user right clicks a treeview to add a node and the maxlength of the treenode name should be 40 chars. Currently I check this in AfterlabelEdit event, and throw a message if no. of chars exceeds. But the requiremnet says to limit the length without showing the message box as we do in textboxes. Thanks. 回答1: You could display a text box over the treeview and set the MaxLength on that. One way

C# TreeView sometimes refuse to paint itself after invalidates

时光总嘲笑我的痴心妄想 提交于 2019-12-23 04:54:42
问题 I use a TreeView to display some informations in two levels : A B 1 D 1 2 ... Sometimes, the informations stored in the treeview differs with the one displayed. It seems that it's because Paint() is not called after Invalidates() . I already tried answer from this question : C# Treeview doesn't refresh after moving nodes, without success. Tree (re)Creation code : using System.Windows.Forms.TreeNode; using System.Windows.Forms.TreeView; [...] private void createTree() { [...]// Creation code /