Here I am giving you complete demo source code of tree view control. After implementing this code you will get complete idea about the tree view in wpf application.
Main Window
<Window x:Class="TreeView.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid>
<TreeView>
<TreeViewItem Header="Basic">
<TreeViewItem Header="class1" >
<TreeViewItem Header="ccc1">
<TreeViewItem Header="class11"/>
<TreeViewItem Header="class12"/>
<TreeViewItem Header="class13"/>
</TreeViewItem>
</TreeViewItem>
<TreeViewItem Header="class1"/>
<TreeViewItem Header="class1"/>
</TreeViewItem>
<TreeViewItem Header="Medium">
<TreeViewItem Header="class1">
<TreeViewItem Header="ccc1">
<TreeViewItem Header="class11"/>
<TreeViewItem Header="class12"/>
<TreeViewItem Header="class13"/>
</TreeViewItem>
</TreeViewItem>
<TreeViewItem Header="class1"/>
<TreeViewItem Header="class1"/>
</TreeViewItem>
<TreeViewItem Header="Higher">
<TreeViewItem Header="class1" >
<TreeViewItem Header="ccc1">
<TreeViewItem Header="class11"/>
<TreeViewItem Header="class12"/>
<TreeViewItem Header="class13"/>
</TreeViewItem>
</TreeViewItem>
<TreeViewItem Header="class1"/>
<TreeViewItem Header="class1"/>
</TreeViewItem>
</TreeView>
</Grid>
</Window>
I hope you are comfortable with tree view now you can try for dynamically also. Let's see output of this code snippets.
0 comments:
Post a Comment