In this step, you will see two different ways to add C1TreeViewItems to the C1TreeView control: in XAML markup and in code.
In XAML
To add static C1TreeViewItems to the C1TreeView control in the XAML:
XAML Copy Code<c1:C1TreeViewItem Header="Book List"></c1:C1TreeViewItem>
XAML Copy Code <c1:C1TreeViewItem Header="Language Books"/> <c1:C1TreeViewItem Header="Security Books"/>
XAML Copy Code <c1:C1TreeViewItem Header="Classic Books"> <c1:C1TreeViewItem Header="Catch-22"/> <c1:C1TreeViewItem Header="The Great Gatsby"/> </c1:C1TreeViewItem>You should have the following XAML markup now included in your file:
XAML Copy Code <Grid> <c1:C1TreeView Name="Tree" > <c1:C1TreeViewItem Header="Book List"> <c1:C1TreeViewItem Header="Language Books"/> <c1:C1TreeViewItem Header="Security Books"/> <c1:C1TreeViewItem Header="Classic Books"> <c1:C1TreeViewItem Header="Catch-22"/> <c1:C1TreeViewItem Header="The Great Gatsby"/> </c1:C1TreeViewItem> </c1:C1TreeViewItem> </c1:C1TreeView> </Grid>
In Code
To add static C1TreeViewItems to the C1TreeView control in the code behind file instead, add the following code in the Code Editor: