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
1 answer

WPF model-bound menu with different ItemContainerStyle at top level and other levels

I am attempting to construct a dynamic WPF menu with different appearance for the top level items and the subsequent level items. In particular, I would like my top level items to display a 32 pixel square image on top of the menu caption, and the…
Larry Lustig
  • 49,320
  • 14
  • 110
  • 160
0
votes
1 answer

Tree View Multiple Level Group Style

I'm working with a treeview and I want to have a multi-level treeview that groups every level of the tree (All Children). It seems to be working for the first level of items but when the items have children underneath it the grouping style doesn't…
Miguel
  • 1,157
  • 1
  • 15
  • 28
0
votes
2 answers

What is the proper way to designate the data context and bind hierarchical data in the treeview?

I have a fairly simple data model: public class ServiceModel { private static readonly IQmiServiceManager ServiceManager = Bootstrap.Instance.DomainManager.QmiServiceManager; private string _serviceName; private…
IAbstract
  • 19,551
  • 15
  • 98
  • 146
0
votes
1 answer

How to show nested relationship in TreeView

Struggling with showing nested relationship in my TreeView. Here is the scenario: In the database I have Category and Account tables. Each category can have zero or more sub-categories so this table has a nested relationship with itself. Each…
dotNET
  • 33,414
  • 24
  • 162
  • 251
0
votes
1 answer

How to assign different DataTypes to a static HierarchicalDataTemplate in XAML?

In converting my treeview to use checkboxes, as in the article by Josh Smith, I find my working xaml code to use multiple HierarchicalDataTemplates of exactly the same format, but with different DataTypes. Is there anyway to define a single static…
Alan Wayne
  • 5,122
  • 10
  • 52
  • 95
0
votes
2 answers

HierarchicalDataTemplate Distinct leaves

I have a set of data that is structured like this: ItemA.GroupA ItemB.GroupA ItemC.GroupB ItemD.GroupC I need to present the data in a WPF Tree View like this: GroupA --- ItemA --- ItemB GroupB --- ItemC GroupC --- ItemD What XAML can I use to…
miguel
  • 2,961
  • 4
  • 26
  • 34
0
votes
1 answer

WPF Expander Hierarchical data Template of 2 levels

I have a repeating data structure like this public class Chapter { public string id { get; set; } public string name { get; set; } public List pages { get; set; } public…
Sebastian
  • 4,625
  • 17
  • 76
  • 145
0
votes
1 answer

HierarchicalDataTemplate what is it supposed to do?

Basically i have a eeview that has a bunch of objects in it and the treeview needs to bind the same properties. here is the code im using and it doesnt seem to work
New Bee
  • 991
  • 1
  • 13
  • 24
0
votes
1 answer

Using a HierarchicalDataTemplate to create a TreeView with child nodes of different UI Controls

I am trying to create a TreeView that allows child nodes of types textBlock and comboBox. Here is a picture of what this would look like: I believe that this is an issue that can be solved by using a HierarchicalDataTemplate because the xaml is the…
Eric after dark
  • 1,768
  • 4
  • 31
  • 79
0
votes
0 answers

WPF TreeView Not Showing Anything

I can't get my data to appear in a tree-view. I have a label above the treeview that is bound to my viewmodel and that works. What have I done wrong with the tree-view? Here's what I've done. Model: public class ViewConfiguration { public…
PeteGO
  • 5,597
  • 3
  • 39
  • 70
0
votes
1 answer

WPF ListView with HierarchicalDataTemplate

I want to create something like a TreeView with the ListView Control. There are two classes with the same base-class like this: public abstract class DataObjectBase { public string Name { get; set; } public override string ToString() { …
Michi-2142
  • 1,170
  • 3
  • 18
  • 39
0
votes
1 answer

wpf using DataTemplate into HierachicalDataTemplate

in Wpf application i've to show the same collection of items into a ListBox and TreeView, The List show only the first level, the TreeView the whole Hierarchical. My Question is: why in the TreeView is not applied the DataTemplate i declared for…
FDB
  • 971
  • 16
  • 32
0
votes
1 answer

HierarchicalDataTemplate - Ignore specific types on generation

My problem is the following: I got a Tree which has an dynamic depth of categories (each category can have sub-categories as well as entries). Now I added a HierarchicalDataTemplate for the categories to display correctly in the TreeView. But I get…
SharpShade
  • 1,761
  • 2
  • 32
  • 45
0
votes
2 answers

Two Lists as children in a WPF TreeView

I have a WPF TreeView that is bound to a list of objects that has several lists in each of them. public List OwnerClasses {get; set;} public class OwnerClass { public List SomeObjects { get; set; } public…
Vaccano
  • 78,325
  • 149
  • 468
  • 850
0
votes
2 answers

How to define a different style on a TreeViewItem based on Type

I have my own treeview implementation based on this post, but I have problems defining a different style based on what object type is in the treeviewitem. I know the simple way is to define a templateselector, but I can't figure out how this would…
Michiel M.
  • 47
  • 1
  • 5