public
class
Node
{
public
Node(
string
myText)
{
this
.Text = myText;
this
.Nodes =
new
ObservableCollection<Node>();
}
public
string
Text {
get
;
set
; }
public
ObservableCollection<Node> Nodes {
get
;
private
set
; }
}
ObservableCollection<Node> nodes =
new
ObservableCollection<Node>();
nodes.Add(
new
Node(
"Company"
));
nodes[0].Nodes.Add(
new
Node(
"Department"
));
nodes[0].Nodes[0].Nodes.Add(
new
Node(
"here are you"
));
radTreeView1.ItemsSource = nodes;
<
Window.Resources
>
<
DataTemplate
x:Key
=
"itemTemplate"
>
<
TextBlock
x:Name
=
"child"
Text
=
"{Binding Text}"
/>
</
DataTemplate
>
<
HierarchicalDataTemplate
x:Key
=
"masterTemplate"
ItemsSource
=
"{Binding Nodes}"
ItemTemplate
=
"{StaticResource itemTemplate}"
>
<
telerik:RadTreeViewItem
Header
=
"{Binding Text}"
/>
</
HierarchicalDataTemplate
>
</
Window.Resources
>
<
Grid
>
<
telerik:RadTreeView
Name
=
"radTreeView1"
ItemTemplate
=
"{StaticResource masterTemplate}"
/>
</
Grid
>
Why "here are you" is not displayed? This is the idea of HierarchicalDataTemplate or not?
Kind regards,
Marinko