I'm trying to set up a TreeView that uses HierarchicalDataTemplates, and I can get the first level of objects to show, but the ItemTemplate for the first data template doesn't seem to be doing anything. I changed the binding of the 2nd data template to a collection that doesn't exist, thinking I would at least get some binding errors, but it looks like the item template is getting completely ignored. At first I thought it was because the collections in the object were using EntityCollections, so I changed to a custom object that uses IEnumerables, but I'm still getting the same result. Here is what I have so far:
and in the code behind I set the DataContext to my collection of objects. Is there anything that would cause the ItemTemplate to get ignored?
Thanks,
Jeremy
<
Telerik:HierarchicalDataTemplate
x:Key
=
"RuleCondition"
ItemsSource
=
"{Binding RuleConditions}"
ItemTemplate
=
"{StaticResource ValidationFunction}"
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
TextBlock
Text
=
"Priority: "
/>
<
TextBlock
Text
=
"{Binding RuleCondition.Priority}"
/>
</
StackPanel
>
</
Telerik:HierarchicalDataTemplate
>
<
Telerik:HierarchicalDataTemplate
x:Key
=
"Rule"
ItemsSource
=
"{Binding}"
ItemTemplate
=
"{StaticResource RuleCondition}"
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
TextBlock
Text
=
"{Binding Rule.Name}"
/>
<
TextBlock
Text
=
" | Description: "
/>
<
TextBlock
Text
=
"{Binding Rule.Description}"
/>
</
StackPanel
>
</
Telerik:HierarchicalDataTemplate
>
<
Telerik:RadTreeView
x:Name
=
"RuleTreeView"
IsEditable
=
"true"
IsLineEnabled
=
"True"
Telerik:StyleManager.Theme
=
"Summer"
ItemTemplate
=
"{StaticResource Rule}"
ItemsSource
=
"{Binding}"
Margin
=
"5"
>
and in the code behind I set the DataContext to my collection of objects. Is there anything that would cause the ItemTemplate to get ignored?
Thanks,
Jeremy