treeview

How to get TreeViewItem from HierarchicalDataTemplate item?

I have a TreeView which uses a HierarchicalDataTemplate to bind its data. It looks like this: <TreeView x:Name="mainTreeList" ItemsSource="{Binding MyCollection}> <TreeView.Resources> <HierarchicalDataTemplate DataType="{x:Type local:MyTreeViewItemViewModel}" ItemsSource="{Binding Children}"> <!-- code code cod...

Question Highlight TreeView Item Being Dragged Over

In my application, I have a TreeView that allows drag/drop. I have all the functionality working fine, however I am having difficulty highlighting a TreeViewItem when it is dragged over. Here is my style for my treeview item. The IsMouseOver trigger does not work while dragging, because dragging seems to block other mouse events. Ca...

TreeView CSS Friendly Output? Control Adapters? ASP.NET 3.5

I want my TreeView control to output <ul><li> tags instead of <tables>. What is the best way to do this. I heard about the CSS Control Adapters. Is this still the best way? How do you go about doing it? ...

Is there a simple library that will render JSON objects as trees?

So, is there a VERY simple library that will render JSON objects as trees? I know that this can be done in many ways (such as YUI), but for debug purposes I'd like to simply be able to view a JSON objects I receive from a server as a tree, nothing fancy (but collapsable tree's would be a bonus). The kind of solution I'm looking for wou...

TreeView control in C#, select() and focus

When i select a node in the treeview it highlights and i show data based on that node below. When i select another control (the treeview loses focus) it is no longer highlighted. How do i keep it highlighted after losing focus? While doing a search i cant tell which node is selected since i must keep the focus on the textbox (so the user...

Find ItemTemplate control in TreeView

My tree definition is: <TreeView Name="tree" ItemsSource="{Binding Children}" > <TreeView.ItemTemplate> <HierarchicalDataTemplate ItemsSource="{Binding Children}"> <CheckBox Name="foo"></CheckBox> </HierarchicalDataTemplate> </TreeView.ItemTemplate> </TreeView> Having a TreeViewItem element, I try t...

Bind a Javascript function to TreeView CheckBox from ServerSide ASP.Net

I have a treeView with ShowAllCheckBox property to true, I need to bind a javascript function to each checkbox on their click event. How to do this can any one suggest ? ...

How do I prevent my treeview from collapsing?

I am using ASP.NET with C# 2.0 and Visual Studio 2005. I am using a Master page and content pages. I have a treeview menu in the master page and when a user selects any menu item I redirect to that content page. My problem is that after a user navigates to the content page all the treenodes refresh and the structure is collapsed. I wan...

TreeView Nodes appear to be caching

I'm creating a custom web user control in c#. It is intended to interact with a permission hierarchy. We have different "sites" and each site has many "apps" and each app has many "permissions" So, We have a TabPanel that loads a tab for each site. Then in each tab we have a TreeView where the parent nodes are the apps and the inner nod...

Converting XML document for use with .NET 2.0 TreeView control

I have an XML file which is in the following format: <root> <category> <doctype> <name>Doc1</name> <site> <name>Site1</name> <target>iframe</target> <url>http://www.gmail.com&lt;/url&gt; </site> </doctype> <doctype> <name>Doc2</name> <site> <name>Site2</name> ...

Populating a standard .net 2.0 GridView / TreeView control using XML from a database as opposed to an XML file

At present I am populating a standard .net 2.0 GridView & TreeView control using a physical XML document which uses an XSLT stylesheet. But i need to make the population of the grid more dynamic, while still using the XSLT style sheet Does anyone know if it is possible to populate a standard .net 2.0 Gridview & TreeView control another ...

TreeNode Image Overlay

I have an imagelist of about 30 images, and 3 images I'd like to be able to overlay on top of the 30 when a TreeNode is in a particular state. I know that a C++ TreeItem can do this with the TVIS_OVERLAYMASK as such: SetItemState(hItem,INDEXTOOVERLAYMASK(nOverlayIndex), TVIS_OVERLAYMASK); Is there any mechanism to achieve similar re...

Can I insert nodes into a TreeView during AfterLabelEdit without beginning to edit them?

I have a subclass of System.Windows.Forms.TreeView that's manually "bound" to a set of hierarchical data. I want the user to be able to edit the labels of the tree, and have the changes reflected back to the data. So I set LabelEdit to true and overrode OnAfterLabelEdit to the tune of: protected override void OnAfterLabelEdit(NodeLabe...

How can I search for an element in a treeview with linq?

I'm searching for a linq-to-objects way to get a TreeViewItem from a treeView. I want to do something like this: var node = from TreeViewItem childs in tree.Items where ((int) childs.Tag) == 1000 select childs; string tag = ((TreeViewItem)node).Tag.ToString(); Then I want to append children t...

c# find TreeViewItem to drop data

I want to drag data from a ListView and drop it in a TreeView(the draging works fine). I use DataBinding and ItemTemplate to fill the TreeView. <TreeView ItemsSource="{Binding Groups}" Name="tvGroups" AllowDrop="True" Drop="tvDrop" DragOver="tvDragOver"> <TreeView.ItemTemplate> <HierarchicalDataTe...

File System TreeView

Im working with file systems and I have a List<> of file objects that have the file path as a property. Basically I need to create a treeview in .NET but im struggling to think of the best way to go about doing this as I need to create a tree structure from a list like: C:/WINDOWS/Temp/ErrorLog.txt C:/Program Files/FileZilla/GPL.html C:...

WPF XmlDataProvider TreeView Error

I have a WPF TreeView control that is binding to an XMLDataProvider. The nodes are appearing fine within the Treeview control however the following error is appearing: System.Windows.Data Error: 43 : BindingExpression with XPath cannot bind to non-XML object.; XPath='Text/*' BindingExpression:Path=; DataItem='XmlDataCollec...

WPF TreeView Clear Selection

How would I clear the TreeView selection within a WPF TreeView? I have tried looping through the TreeNodes and clearing the IsSelected property however that is a ReadOnly property. Any ideas? The TreeView is using XML Binding through the XMLDataProvider object. ...

C# TreeView.GetNodeAt() problem with clicking images.

Hi. I'm using the click event on the TreeView to do some stuff when a node is clicked in the TreeView. I do this by getting the node that is click on by calling GetNodeAt() with the mouse coordinates, like this: private void TreeView_Click(object sender, System.EventArgs e) { MouseEventArgs mouseEventArgs = e as MouseEventArgs; ...

WPF: Combobox in TreeviewItem

Hi all! I'm newbie in WPF, so sorry about stupid question. It is possible to show combobox side by side with selected TreeViewItem? I need something like shown in the left picture at the following link: http://www.mypicx.com/03242009/Combobox_in_TreeviewItem/ I tried to do thus: <TreeView Name="treeView1"> <Tr...