Questions tagged [treeview]

TreeView control is used to display hierarchical information.

A tree view (control) displays a hierarchy of nodes, where the user can expand and collapse these nodes while navigating through the control. Often a tree view will provide the user the ability to view or edit additional information relating to the node selected.

Tree views are often used to present hierarchical data, such as an XML document or files and folders structure.

9439 questions
31
votes
4 answers

Checkbox not visible on nodes of TreeView control when deployed in IIS

I am facing issue with regards to the TreeView control. I have checkbox enabled for nodes of TreeView control. It is working fine and showing properly. But when I deploy same to IIS, checkbox is not visible there. It is not rendered at all. Below is…
Ubaid Ashraf
  • 1,049
  • 5
  • 15
  • 43
31
votes
7 answers

How to filter a wpf treeview hierarchy using an ICollectionView?

I have a hypothetical tree view that contains this data: RootNode Leaf vein SecondRoot seeds flowers I am trying to filter the nodes in order to show only the nodes that contain a certain text. Say if I specify "L", the tree will be…
David
  • 9,635
  • 5
  • 62
  • 68
31
votes
6 answers

Enable scroll for WPF Treeview

Can anybody help me out with how to enable a treeview to scroll? There must be a simple way but I can't make it work in my code. After multiple failed tries, I currently have something like this:
Ronald
  • 1,990
  • 6
  • 24
  • 39
30
votes
6 answers

How to select TreeView item from code

I have a three level treeview. How do I select any item in third level from code? I tried a method mentioned in many blogs and on stackoverflow but it seems to work only for first level (dbObject is null for items on below first level). Here is the…
Sergej Andrejev
  • 9,091
  • 11
  • 71
  • 108
30
votes
2 answers

populate treeview from list of file paths in wpf

There are several examples of how to populate a tree view from a collection of file paths such as this or this other example. I cannot seem to find such example for WPF. I know I can integrate windows forms and use a different control in order to…
Tono Nam
  • 34,064
  • 78
  • 298
  • 470
28
votes
3 answers

TreeView Remove CheckBox by some Nodes

I want remove CheckBoxes where the Node.Type is 5 or 6. I use this code: private void TvOne_DrawNode(object sender, DrawTreeNodeEventArgs e) { int type = (e.Node as Node).typ; if (type == 5 || type == 6) { Color backColor,…
Werewolve
  • 2,448
  • 5
  • 24
  • 38
28
votes
6 answers

WPF TreeView - How to scroll so expanded branch is visible

When I expand items in my treeview so that scrolling is necessary, a scrollbar appears. However, it doesn't scroll down for the newly expanded branch of items - they get cropped by the bottom of the control. So as I continue expanding items at the…
Jared
  • 649
  • 2
  • 8
  • 15
28
votes
6 answers

How to make WPF TreeView style as WinForms TreeView?

WPF default TreeView is very good, I still want it have lines joint each its child element, like Windows Forms TreeView. I have searched on internet and have some example, but it did not designed well enough. How can I achieve it with WPF?
NoName
  • 7,940
  • 13
  • 56
  • 108
28
votes
4 answers

Is there a method for searching for TreeNode.Text field in TreeView.Nodes collection?

Like this: TreeNode[] treeNodes = treeView.Nodes.Find(searchString, true); but I want it to search in the text field instead of the name field.
Romz
  • 1,437
  • 7
  • 36
  • 63
27
votes
1 answer

Having HierarchicalDataTemplates in a TreeView

With regards to a question I posted earlier on (WPF: Correctly storing an object in a TreeViewItem) Is it possible to have nested HierarchicalDataTemplates in a TreeView? Take the following example: Code: public class Artist { private…
Andreas Grech
  • 105,982
  • 98
  • 297
  • 360
27
votes
8 answers

Is there a way to make a TreeView appear always fully expanded?

I have a TreeView on my form but I'd like it to always be fully expanded, even the child nodes. Is there a way?
delete
27
votes
9 answers

WinForms TreeView - how to manually "highlight" node (like it was clicked)

I would need to know how to let the programatically selected node make graphically in the state "selected" like the user clicked on it. SelectedNode only makes this one internally selected. Thank you very much!
Petr
  • 7,787
  • 14
  • 44
  • 53
26
votes
4 answers

wpf treeview binding

Is there any simple tutorial for beginners about treeview binding in WPF? What should we write in ItemsSource, DataType, ItemTemplate attributes if there's one List of items? IList items = new…
pojo
  • 307
  • 1
  • 4
  • 4
26
votes
5 answers

Scroll selected TreeView node into view

I have a System.Windows.Forms.TreeView docked inside a panel. I am setting a node selected programmatically. What method or property would I use to have the treeview scroll the selected into view?
Brad
  • 20,302
  • 36
  • 84
  • 102
26
votes
6 answers

Allow multi-select in a .NET TreeView

I'm stuck in .NET 2.0 Windows Forms. It doesn't look like the ability to select multiple nodes exists in the standard TreeView control. I'm trying to do this for a context menu selection. So check boxes aren't an acceptable UI paradigm here. What's…
Darcy Casselman
  • 2,574
  • 3
  • 24
  • 26