<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TreeDataBindings.aspx.cs" Inherits="TreeDataBindings" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
   <title>TreeView DataBindings</title>
   <link href="chapterStyles.css" type="text/css" rel="stylesheet"/>
   <style type="text/css">
      h2 { background-color: #A6B4DB; width: 15em; padding: 0.5em;}
      .tree { border: solid 1pt #4859A7; width: 15em;}
   </style>
</head>
<body>
   <form id="form1" runat="server">
   <div id="container">
      <h1>Test Data Binding with TreeView Control</h1>
      <p>This example illustrates the use of data bindings with the <code>TreeView</code> control.</p>

      <h2>Sample Tree</h2>      
<asp:TreeView ID="treeMain" runat="server" CssClass="tree" 
   DataSourceID="xmlSource" ShowCheckBoxes="Leaf"
   MaxDataBindDepth="1" NodeIndent="18">
   <DataBindings>
      <asp:TreeNodeBinding DataMember="Category" TextField="Name"   ImageUrlField="Icon" />
      <asp:TreeNodeBinding DataMember="Book" TextField="Title" />
   </DataBindings>
   <RootNodeStyle HorizontalPadding="4" />
</asp:TreeView>

<asp:XmlDataSource id="xmlSource" runat="server"
   DataFile="menuMapping.xml" XPath="/Books/Category"/>

   </div>
   </form>
</body>
</html>
