hierarchicaldatatemplate

C1HierarchicalDataTemplate / C1TreeView Problem

Hi! I've a problem building up a ComponentOne TreeView in Silverlight (C1TreeView) with a C1HierarchicalDataTemplate. In detail the Tree only shows 2 levels (H1 and H2), although 3 levels are defined through HierarchicalDataTemplates like: <c1:C1HierarchicalDataTemplate x:Key="H3Template"> <TextBlock FontWeight="Bold" Text="...

Recursive HierarchicalDataTemplate (WPF)

I'm not sure how to approach this: I want a TreeView that will display some simple data from a hierarchical data structure. As a basic example (In XML, cause it's easy to type): <Node text="Root"> <Node text="Item 1"> <Node text="Item 1.1" /> </Node> <Node text="Item 2"/> </Node> The catch is that this could theore...

How could I implement this strange WPF TreeListDataGridView?

As you can see in the image below I have a tree datamodel consisting of groups that can contain other groups plus an arbitary number of items wich again can hold Parameters. The Parameters itself are defined globally and just reoccur in the items. Only the parameter's actual value may differ from parameter usage to parameter usage in the...

WPF Databinding more complex XML Structure

Hello, I asked this question already at the Microsoft forums, but no answer until now. I am stuck here. I have a quite nested xml snippet, which i like to bind via hierarchical Data templates. Here is the xml snippet: <project> <products> <product name="Product2" foldername="string" dbkey="-2405" dbtable="string"> <ini...

Silverlight Toolkit TreeView control and expandability

Is it possible to configure the TreeView control in the Silverlight tookit such that some or all of the hierarchy levels will be automatically expanded and ideally something that can't be collapsed at that level. I'm using this control in large part due to the ease of handling hierarchical data and the ease with which I CAN expand/colla...

How to get TreeViewItem from HierarchicalDataTemplate item?

I have a TreeView which uses a HierarchicalDataTemplate to bind its data. It looks like this: <TreeView x:Name="mainTreeList" ItemsSource="{Binding MyCollection}> <TreeView.Resources> <HierarchicalDataTemplate DataType="{x:Type local:MyTreeViewItemViewModel}" ItemsSource="{Binding Children}"> <!-- code code cod...

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 List<TypeA> TypeAList { get; private set; } } The List that the ItemsControl binds to is...

WPF HierarchicalDataTemplate

Could anyone explain how HierarchicalDataTemplate works What Controls supports HierarchicalDataTemplate? What does a control need to support HierarchicalDataTemplate? UPDATE What causes the TreeView to render the parent and child nodes when the same HierarchicalDataTemplate in a HeaderedItemsControl only causes the parent to be ren...

Using HierarchicalDataTemplate.Triggers to affect controls in the ItemTemplate

I have a treeview with a HierachicalDataTemplate (shown below) bound to a datarelation in a dataset. The parent nodes represent parent parts and the children represent parts that make up the parent. In some cases the user will check the checkbox at the parent level to indicate they are replacing the entire part with all its children. At ...

Adding a style to HierarchicalDataTemplate generated MenuItems

I'm adding my hierarchical data to a Menu-Control using the HierarchicalDataTemplate. <HierarchicalDataTemplate DataType="{x:Type local:MyType}" ItemsSource="{Binding Path=SubItems}"> <StackPanel> <TextBlock Text="{Binding Name}"/> </StackPanel> </HierarchicalDataTemplate> My Menu is created like this <Menu> <Menu...

C# WPF How do I get a TreeViewItem from HierarchicalDataTemplate item?

I have the same problem as a previous question on this forum: previous thread I have a TreeView which uses a HierarchicalDataTemplate to bind its data. I need to get the TreeViewItem from the selected item, which is my own class. I have tried the solution given in the previous thread as well as modified versions of it. Nothing works....

How to group consecutive similar items of a collection?

Consider the following collection. True False False False True True False False I want to display it in a structured way, say, in a TreeView. I want to be able to draw borders around entire groups and such. True Group True False Group False False False True Group True True False Group False False How do I accomplish this ...

Own template for leaf nodes in a WPF TreeView with unknown levels

Hi! I'm trying to add checkboxes to the leaf nodes in a TreeView in WPF. I know how to do this if we have a fixed number of levels in the hierarchy and using a HierarchicalDataTemplate for each level. But what to do when I want this: -Node 1 -- Node 1a (leaf node with checkbox) -- Node 1b --- Node 1bI (leaf node with checkbox) -Node 2 --...

Can I have a Treeview without the tree structure?

Hi all, Can someone tell me how I can template a treeview control so that it doesn't look like a tree? Basically, I want to remove the indents at various levels as well as the +/- that allow for expansion and collapse. The actual requirement is that I have a hierarchical data template that is bound to an object collection that is rec...

ControlTemplate for second level of TreeView

I'm trying to create a TreeView which has two levels but I'm getting nowhere. I have an ItemTemplateSelector (which works - selecting either of the first two templates listed below), but I can't get the children to populate using a DataTemplate. This is my code: public class PlannedMealGroup : INotifyPropertyChanged { public Obs...

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 would be greatly appreciated <Window x:Class="TestCheckBoxBinding.Window1" xmlns="http://sche...

WPF TreeView binding through XAML

So I have a class structure like this Store Owner Cashier List of Products Product Name Price List of Vendors Company Name Contact Name So there are 4 objects: Store, Person (Owner and Cashier), Product and Vendor. I want to find a way to bind this structure into a XAML tree, so each no...

How to reference a generic type in the DataType attribute of a HierarchicalDataTemplate?

I have a class of MyClass<MyObject> and want to set it as the DataType for a HierarchicalDataTemplate. What is the syntax for this in XAML? (I know how to set namespaces, I need just the <HierarchicalDataTemplate DataType="{X:Type ..... syntax ...

creating a HierarchicalDataTemplate in Silverlight with code

I'm trying to create a HierarchicalDataTemplate (from the Silverlight Toolkit) in code in Silverlight following this advice on creating DataTemplates from code: http://stackoverflow.com/questions/59451/creating-a-silverlight-datatemplate-in-code. However, I haven't been able to get it to work for HierarchicalDataTemplate. I tried using ...

Silverlight: How to change TreeViewItem text color when it selected

I have TextBlock inside HierarchicalDataTemplate. I need to set foreground color to Red when TreeViewItem selected. <controls:TreeView Background="#FF939597" ScrollViewer.HorizontalScrollBarVisibility="Disabled" x:Name="CommentTreeView" Margin="0,0,0,118" ItemContainerStyle="{StaticResource SectionsTreeViewItemStyle}"...