Hello, i have a tree data structure like the following:
how can I bind to this datastructure?
Using your WPF Treeview I was able to do using the following code (data context is a root node that is not displayed)
I do not understand how to do with winforms version of treeview control.
Can anybody please help?
public
class
MyTreeNode
{
public
string
Display{
get
;
set
;}
public
List
<MyTreeNode> childs {
get
;
set
;}
}
how can I bind to this datastructure?
Using your WPF Treeview I was able to do using the following code (data context is a root node that is not displayed)
<
TreeView
Name
=
"treeView1"
ItemsSource
=
"{Binding Childs}"
>
<
TreeView.ItemTemplate
>
<
HierarchicalDataTemplate
ItemsSource
=
"{Binding Childs}"
>
<
StackPanel
Orientation
=
"Horizontal"
Height
=
"18"
>
<
TextBlock
Text
=
"{Binding Display}"
/>
</
StackPanel
>
</
HierarchicalDataTemplate
>
</
TreeView.ItemTemplate
>
</
TreeView
>
I do not understand how to do with winforms version of treeview control.
Can anybody please help?