WPF Web Based

WPF Examples

WPF

WPF Projects

WPF Project

adplus-dvertising
TreeView Control inWPF Web Base
Previous Home Next

A TreeView Shows data in a hierarchical Form in a parent child relationship where a parent node can be expanded .You can use the TreeView control to display information from a wide variety of data sources such as an XML file, site-map file, string, or from a database.

Or you can say treeview control is a hierarchical structure to dispaly the data. its look like a tree. it also contain root node, parent node and child node like tree.

Features:

  1. Internet Explorer Favorites style view.
  2. Append a number to any node, allowing you to create an Outlook style folder list with message counts.
  3. Choose Font and Colour on an item-by-item basis, and set the control's back colour.
  4. Bolding of items
  5. InfoTip (multi-line tooltip) support with full control over InfoTip colour
  6. Works with Microsoft or API ImageLists.
  7. Item check boxes
  8. Full-Row select mode
  9. Single-Click expand mode
  10. Supports Two Images per item: one standard icon and a state icon.
  11. Disable Custom Draw for maximum speed
  12. Speed-optimised Clear method

Example of Treeview Control:

<Page x:Class="WpfBrowserApplication5.Page13"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Page13" Loaded="Page_Loaded">
    <Grid>
	<ListView>
	<TreeView Name="tree1" Background="LightCyan"  >
	<TreeViewItem Header="File" Background="Red" FontSize="15">
    </TreeViewItem>
	<TreeViewItem Header="Edit" Background="Red" FontSize="15" >
	</TreeViewItem>
	</TreeView>
	</Grid>
</Page>

.XAML.CS CODE:

private void Page_Loaded(object sender, RoutedEventArgs e)
{          
Dictionary<string, List<string>> items = new Dictionary<string, List<string>>()
{
{"File",new List<string>() {"New","Open","ADD","Save","Save As","Close"}},
{"Edit",new List<string>() {"Undo","Cut","Copy","Paste","Delete"}},
}; 
foreach (TreeViewItem tv in tree1.Items)
{
foreach (string item in items[tv.Header.ToString()])
tv.Items.Add(item);}
}
}
Output:
Previous Home Next
WPF Examples

WPF

WPF

WPF

WPF

WPF

WPF

WPF

WPF