TreeView Demo

This demo illustrates how to use the IE Web Controls TreeView control to statically display hierarchical information. Specifically, this demo uses the TreeView control to display a family tree.


  Isaac Gibson
  Birth - 1766
  Death - 1827
  Spouse


Source Code

<%@ Register TagPrefix="ie" 
      Namespace="Microsoft.Web.UI.WebControls" 
      Assembly="Microsoft.Web.UI.WebControls" %>


<form runat="server">
  <ie:TreeView runat="server">
    <ie:TreeNode Text="Isaac Gibson" Expanded="True">
      <ie:TreeNode Text="Birth - 1766" />
      <ie:TreeNode Text="Death - 1827" />
      <ie:TreeNode Text="Spouse">
        <ie:TreeNode Text="Ritty Gibson" />
        <ie:TreeNode Text="Married 1789" />
        <ie:TreeNode Text="Children">
          <ie:TreeNode Text="Phoebe Gibson">
            <ie:TreeNode Text="Birth - 1790" />
            <ie:TreeNode Text="Death - 1884" />
            <ie:TreeNode Text="Spouse">
              <ie:TreeNode Text="James K. Mason" />
              <ie:TreeNode Text="Married 1819" />
            </ie:TreeNode>
          </ie:TreeNode>
          <ie:TreeNode Text="John Gibson">
            <ie:TreeNode Text="Birth - 1793" />
            <ie:TreeNode Text="Death - 1802" />
          </ie:TreeNode>
          <ie:TreeNode Text="Howard Gibson">
            <ie:TreeNode Text="Birth - 1795" />
            <ie:TreeNode Text="Death - 1863" />
            <ie:TreeNode Text="Spouse">
              <ie:TreeNode Text="Elizabeth Gibson" />
              <ie:TreeNode Text="Married 1825" />
            </ie:TreeNode>
          </ie:TreeNode>
        </ie:TreeNode>
      </ie:TreeNode>
    </ie:TreeNode>
  </ie:TreeView>
</form>

[Return to the article]