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.

8856 questions
250
votes
20 answers

Data binding to SelectedItem in a WPF Treeview

How can I retrieve the item that is selected in a WPF-treeview? I want to do this in XAML, because I want to bind it. You might think that it is SelectedItem but apparently that does not exist is readonly and therefore unusable. This is what I want…
Natrium
  • 29,076
  • 15
  • 55
  • 71
108
votes
5 answers

Is there any publicly accessible JSON data source to test with real world data?

I'm working on a JavaScript dynamically loaded tree view user control. I'd like to test it with real world data. Does anybody know any public service with an API that provides access to hierarchical data in JSON format?
ILya
  • 2,552
  • 4
  • 25
  • 40
103
votes
11 answers

Select TreeView Node on right click before displaying ContextMenu

I would like to select a WPF TreeView Node on right click, right before the ContextMenu displayed. For WinForms I could use code like this Find node clicked under context menu, what are the WPF alternatives?
alex2k8
  • 39,732
  • 56
  • 158
  • 214
74
votes
10 answers

Find node clicked under context menu

How can I find out which node in a tree list the context menu has been activated? For instance right-clicking a node and selecting an option from the menu. I can't use the TreeViews' SelectedNode property because the node is only been right-clicked…
Sam
  • 5,172
  • 7
  • 41
  • 49
61
votes
4 answers

WPF TreeView HierarchicalDataTemplate - binding to object with multiple child collections

I am trying to get a TreeView to bind my collection so that all groups show nested groups and each group will show entry. How can I use the HierarchicalDataTemplate so that the TreeView will process both SubGroups and Entries collection? Groups show…
longday
  • 3,665
  • 4
  • 26
  • 35
58
votes
1 answer

Weird scroll behavior in latest Blink-included browsers (like Chrome, Opera)

Recently I've been working on building a tree-view component library for Angular, as ngx-tree. Problem Soon after I figured out how to implement a virtual-scroll feature for this library for performance with large data set, and got it to run…
e-cloud
  • 3,891
  • 1
  • 19
  • 37
57
votes
3 answers

WPF TreeView: How to style selected items with rounded corners like in Explorer

The selected item in a WPF TreeView has a dark blue background with "sharp" corners. That looks a bit dated today: I would like to change the background to look like in Explorer of Windows 7 (with/without focus): What I tried so far does not…
Helge Klein
  • 8,577
  • 8
  • 44
  • 69
56
votes
16 answers

How to programmatically select an item in a WPF TreeView?

How is it possible to programmatically select an item in a WPF TreeView? The ItemsControl model seems to prevent it.
Thomas Bratt
  • 40,822
  • 34
  • 113
  • 133
56
votes
13 answers

C# Winforms bold treeview node doesn't show whole text

I'm using the following code to make my treenodes bold: Font font = new Font(tvQuestionSequence.Font, FontStyle.Bold); foreach (QuestionnaireBuilder_Category cat in categories) { TreeNode node = new TreeNode(); node.Text =…
Martijn
  • 22,949
  • 59
  • 161
  • 247
52
votes
12 answers

Is there way to expand all folders in Eclipse project view and search results?

I'm spending a lot of time manually expanding deeply-nested folders in tree views like the Project Explorer and the File Search result tree. Is there a keyboard shortcut or menu command to expand all folders?
meva
  • 812
  • 2
  • 8
  • 10
50
votes
4 answers

Customizing the TreeView to allow multi select

The built-in WPF TreeView control does not allow for multi selection, like a ListBox does. How can I customize the TreeView to allow for multi selection without rewriting it.
Dylan
  • 2,272
  • 6
  • 26
  • 33
49
votes
5 answers

AutoExpand treeview in WPF

Is there a way to automatically expand all nodes from a treeview in WPF? I searched and didn't even find an expand function in the treeview property. Thanks
David Brunelle
  • 6,190
  • 10
  • 57
  • 101
43
votes
7 answers

WPF TreeView: Where is the ExpandAll() method

How can I expand all TreeView nodes in WPF? In WinForms there was a ExpandAll() method which does this.
mehdi
43
votes
10 answers

Android Treeview

I know there is the ExpandableListView but it only supports up to 2 levels. I need a true treeview vertical list with at least up to ~5 levels (more is better). Any suggestions? edit: I see talk about using a Custom Adapter and setting the padding…
Daniel Sloof
  • 12,051
  • 14
  • 68
  • 104
42
votes
4 answers

Why isn't there a SelectedNodeChanged event for Windows.Forms.TreeView?

The System.Web.UI.WebControls.TreeView class offers this event, but the Forms version of TreeView doesn't. What's the equivalent in the Forms world? I'm using AfterSelect but it doesn't seem quite right. Maybe it is in fact what I'm looking for but…
I. J. Kennedy
  • 21,946
  • 16
  • 59
  • 87
1
2 3
99 100