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

Different sets of HierarchicalDataTemplates with DataType property for different TreeViews

I have a WPF TreeView bound to a hierarchy of objects of mixed types. Therefore, I use HierarchicalDataTemplates with the "DataType" property to specify the template used for each type, which works fine (the TreeView automatically catches the right…
juniper
  • 311
  • 5
  • 13
0
votes
1 answer

WPF HierarchicalDataTemplate & ItemsControl

I have a list containing objects that follow this structure. This is not the real classes I am working with, but should explain the concept. CLASSES public class BaseType{} public class TypeA : BaseType{} public class TypeB: BaseType { public…
thmsn
  • 1,976
  • 1
  • 18
  • 25
0
votes
1 answer

Treeview HierarchicalDataTemplate Howto - WCF Ria Services LoadOperation

Db class propertys [Serializable] [EnableClientAccess()] public class DbPersonelJobDetail { public DbPersonelJobDetail() { } [Key] public Guid PersonelID { get; set; } public Guid JobID { get; set; } public string…
0
votes
1 answer

Data binding to a TreeView using HierarchicalDataTemplate

I'm trying to get the TreeView control in my application to properly bind to a tree of objects by setting its ItemsSource and DataContext properties. The tree visualizes as expected, but the TreeViewItems data context seems to hold incorrect…
mcmlxxxvi
  • 1,358
  • 1
  • 11
  • 21
0
votes
1 answer

TreeViewItem not selectible with datacontext

When I set the treeviewitem's header via a DataContext, it adds a few pixels of padding that are clickable, and then puts the text with isn't clickable. I shall post an image; blue: clickable, red: unclickable. The classes that store the…
0
votes
1 answer

HierarchicalDataTemplate binding

I have an hierarchical Treeview which each item contains a complexed entity which consists of: Border -- Check box -- TextBlock i want to change the opacity of the border whenever the checkbox IsEnabled property is set to "False" this is what i…
Ori Price
  • 3,593
  • 2
  • 22
  • 37
0
votes
2 answers

How to get this binding for item instead of TreeViewItem?

I got the following code :
nakiya
  • 14,063
  • 21
  • 79
  • 118
0
votes
1 answer

Databinding to multiple type of Objects for Menu

I am developing a WPF project, following is the code for my data model of Menu class NavigationMenu { public abstract class MenuBase { public MenuBase() { } public MenuBase(string…
Muhammad Ummar
  • 3,541
  • 6
  • 40
  • 71
0
votes
1 answer

How to bind a property of ViewModel to an element in HierarchicalDataTemplate of a Treeview?

How to bind a property of ViewModel to an element in HierarchicalDataTemplate of a Treeview (the property is is out of HierarchicalDataTemplate.Itemsource) this is the example and the probelm is in this line: Visibility="{Binding IsCheckBoxVisible ,…
mahboub_mo
  • 2,908
  • 6
  • 32
  • 72
0
votes
1 answer

Hide Elements in WPF TreeView

i have the following scenario: I have a ViewModel with hierachical elements to display in a TreeView. So far so good. What i want to do now is hide/remove elements from the TreeView according to some property set on a ViewModel-Element, like…
opiswahn
  • 435
  • 1
  • 5
  • 17
0
votes
3 answers

How do you put an ObservableCollection into a Textblock

I need to put my ObservableCollection into my TextBlock. Here is my code. Right now it is showing the Item and the SubItems, but where the messages show it has…
JLott
  • 1,818
  • 3
  • 35
  • 56
0
votes
2 answers

I need to add an observablecollection to an observablecollection.

Here is my code and what the output is when I run it. I am really at a loss on this one. Any help would be appreciated. VALIDATIONITEM CLASS: using System; using System.Collections.Generic; using System.Linq; using System.Text; using…
JLott
  • 1,818
  • 3
  • 35
  • 56
0
votes
1 answer

Using HierarchicalDataTemplate and Observable in WPF

I need to use an ObservableCollection and only one class. Here is my code. For some reason I cannot get the TreeView to populate with the Observable Collection . Any help would be appreciated. XAML:
JLott
  • 1,818
  • 3
  • 35
  • 56
0
votes
2 answers

HierarchicalDataTemplate issue

I need some help with HierarchicalDataTemplate... I am trying to build a TreeView to display some hierarchical data like this: RuleSet <- (root) -RuleA RuleB RuleC RuleA ..... RuleD RuleA, ... are derived from the same…
Victor
  • 260
  • 1
  • 3
  • 13
-1
votes
1 answer

Use TreeView hierarchy with HierarchicalDataTemplate from inside a DataTemplate

I have a WPF application which uses a TreeView, inside that TreeView there are multiple HierarchicalDataTemplates/DataTemplates for different types, each containing a ContentControl with a specific Template, like so: TreeView |-…
marxlaml
  • 321
  • 2
  • 11
1 2 3
20
21