Questions tagged [hierarchicaldatatemplate]

A `HierarchicalDataTemplate` is a subclass of `DataTemplate` that allows you to bind directly to a hierarchy of objects

A HierarchicalDataTemplate is a subclass of DataTemplate that allows you to bind directly to a hierarchy of objects. This provides a powerful means to bind a hierchy of objects to wpf controls that deal with such data, such as TreeViews and Menus.

305 questions
0
votes
2 answers

Producing a hierarchy of treeview in xaml

This seems like a common question but I have not been able to get it working from the answers of other questions. I have a company, which has multiple projects, and each project can have multiple tasks. The company class contains some metadata and…
Jimmy T
  • 447
  • 6
  • 14
0
votes
1 answer

Checkbox click copy texblocks in to a string list

In the HierarchicalDataTemplate, i got 2 textblocksand I want to copy the texts from the both. During the check-box click/check it'll update the text to a list. The function is getting the text from one textblock. How can i get text from both…
linguini
  • 1,939
  • 5
  • 49
  • 79
0
votes
1 answer

WPF Treeview Icon Plus Minus

I'm trying to add icons in my treeview but it's not showing up. The HierarchicalDataTemplate is in the windows resources and treeview is in the Grid. Can any body tell me what is the mistake i'm making? Here is the XML:
linguini
  • 1,939
  • 5
  • 49
  • 79
0
votes
1 answer

Can't type in textbox in HierarchicalDataTemplate

I am unable to type in textbox's on a treeview. Some keys do work, such as space and backspace, but no character keys work. The textbox is getting both PreviewKeyDown and KeyDown events (and the up equivalents) for all keys. Bindings are working…
The Grand User
  • 727
  • 4
  • 14
0
votes
1 answer

Text Box Validation in item template is not working

I am having the text box in item template like below.
shahul hameed
  • 151
  • 2
  • 16
0
votes
1 answer

HierarchialDataTemplate for adding mixed data to treeview

Hi I have a tree view to display some hierarchical data. My classes were as follows public class Response { public string UserId { get; set; } public CaseItems Cases { get; set; } } public class CaseItem { public int ID { get; set; } …
Rahul W
  • 833
  • 11
  • 26
0
votes
1 answer

How to dynamically set up TreeView

Using WPF I would like to have a TreeView that displays data from a Compact Database variably. That means I would like to change the view based on how the user would like it sorted. Assuming that the database has the following tables and schema,…
Daro
  • 1,990
  • 2
  • 16
  • 22
0
votes
2 answers

Binding hierarchical data with templates using a generic Tree data structure

How to bind a Tree data structure using hierarchical data template to a tree list control. The difference is that instead of creating different types for each level in hierarchy I intend to use only one type “Node” differentiated by the “Type”…
TrustyCoder
  • 4,749
  • 10
  • 66
  • 119
0
votes
1 answer

TreeView child nodes - input validation in wpf

I have a tree view like below. R1 P1 Child 1 P2 Child 1 XX Child 3 Say i want to display error message either in a) tree node or b) its container based on the value my validation rule. For exmaple if i apply the validation logic for this…
0
votes
1 answer

In WPF, Apply different DataTemplate to the same Item at a different level of TreeView

Kind of an odd problem I have here. I have a pretty basic recursive tree structure: public class TreeNode { public string Name { get; set; } public IEnumerable Children { get; set; } } and am displaying the data in a TreeView…
Luke Willis
  • 8,429
  • 4
  • 46
  • 79
0
votes
1 answer

How to get DataTemplate to Recognize GenericType

I am displaying nodes in a TreeView control, and I am having issues with getting the data to display correctly with generics. More specifically, it seems that WPF is having trouble locating the data template. I'm guessing it is because the x:Type is…
John Kraft
  • 6,811
  • 4
  • 37
  • 53
0
votes
1 answer

How do I use TreeView.Resources HierarchicalDataTemplate DataType to specify a Dictionary>?

I have a list of OBJs, that I've stored into List OBJS property, and I've created a HierarchicalDataTemplate for the Data, which works (see below).
Bob.
  • 3,894
  • 4
  • 44
  • 76
0
votes
1 answer

WPF: TreeView and nested templates

I'm trying to display a class using a treeview but nothing is displayed. I've inspected the container with Snoop and I see the StackPanel, but it's empty, even the the project does have a title and pages. There are no binding errors and I have no…
Echilon
  • 10,064
  • 33
  • 131
  • 217
0
votes
0 answers

TreeView with different typed objects

I´m currently trying to create a language editing tool. The structure is like this:
SharpShade
  • 1,761
  • 2
  • 32
  • 45
0
votes
1 answer

WPF - Binding to CheckBox not working in a HierarchicalDataTemplate

In a WPF treeview I am trying to automatically check the children if the parent node is being checked. I am using a view model for that and a bindable object for the nodes, however all my attempts failed. Here is the code (C# + XAML). Any ideas…
Dan
  • 1
  • 1