<%@ Control Language="c#" AutoEventWireup="True" Codebehind="CheckBoxes.ascx.cs" Inherits="ASPNETExpert.WebControls.Demo.Tree.Programming.CheckBoxes" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
<%@ Register TagPrefix="ec" Namespace="ASPNETExpert.WebControls" Assembly="ASPNETExpert.WebControls" %>
<%@ Register TagPrefix="ecd" Namespace="ASPNETExpert.WebControls.DemoControls" Assembly="ASPNETExpert.WebControls.DemoControls" %>
<table cellpadding="0" cellspacing="5" border="0" width="100%" xmlns:ec="urn:http://aspnetexpert.com/ExpertControls.xsd">
<tr>
<td valign="top">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="formtext"><asp:CheckBox Runat="server" AutoPostBack="True" ID="AutoCheckChildren" Text="AutoCheckChildren" oncheckedchanged="AutoCheckChildren_CheckedChanged"></asp:CheckBox></td>
</tr>
<tr>
<td class="formtext"><asp:CheckBox Runat="server" AutoPostBack="True" ID="AutoUnCheckChildren" Text="AutoUnCheckChildren" oncheckedchanged="AutoCheckChildren_CheckedChanged"></asp:CheckBox></td>
</tr>
<tr>
<td>
<ec:ExpertTree id="CheckBoxesTree" Skin="XP" runat="server" CheckBoxes="true" ExpandOnClick="true"
CollapseOnClick="true">
<TreeLook Base="XP" Width="260px" Height="380px" Overflow="Scroll" />
<Nodes>
<ec:TreeNode Text="North America" Expanded="True">
<Nodes>
<ec:TreeNode Text="U.S.A." Expanded="True">
<Nodes>
<ec:TreeNode Text="New York" />
<ec:TreeNode Text="Los Angeles" />
<ec:TreeNode Text="Boston" Enabled="False" />
<ec:TreeNode Text="Chicago" Enabled="False" />
</Nodes>
</ec:TreeNode>
<ec:TreeNode Text="Canada">
<Nodes>
<ec:TreeNode Text="Toronto" />
<ec:TreeNode Text="Vancouver" />
<ec:TreeNode Text="Calgary" />
<ec:TreeNode Text="Ottawa" />
</Nodes>
</ec:TreeNode>
<ec:TreeNode Text="Mexico">
<Nodes>
<ec:TreeNode Text="Campeche" />
<ec:TreeNode Text="Guadalajara" />
<ec:TreeNode Text="Mexico City" />
<ec:TreeNode Text="Puebla" />
</Nodes>
</ec:TreeNode>
</Nodes>
</ec:TreeNode>
<ec:TreeNode Text="Europe">
<Nodes>
<ec:TreeNode Text="England">
<Nodes>
<ec:TreeNode Text="London" />
<ec:TreeNode Text="Liverpool" />
<ec:TreeNode Text="Leeds" />
<ec:TreeNode Text="Manchester" />
</Nodes>
</ec:TreeNode>
<ec:TreeNode Text="France">
<Nodes>
<ec:TreeNode Text="Paris" />
<ec:TreeNode Text="Cannes" />
<ec:TreeNode Text="Grenoble" />
<ec:TreeNode Text="Toulouse" />
</Nodes>
</ec:TreeNode>
<ec:TreeNode Text="Germany">
<Nodes>
<ec:TreeNode Text="Berlin" />
<ec:TreeNode Text="Bonn" />
<ec:TreeNode Text="Bremen" />
<ec:TreeNode Text="Munich" />
</Nodes>
</ec:TreeNode>
</Nodes>
</ec:TreeNode>
<ec:TreeNode Text="South America">
<Nodes>
<ec:TreeNode Text="Brasil">
<Nodes>
<ec:TreeNode Text="Rio de Janeiro " />
<ec:TreeNode Text="Sao Paulo" />
<ec:TreeNode Text="Campinas" />
<ec:TreeNode Text="Brasilia" />
</Nodes>
</ec:TreeNode>
<ec:TreeNode Text="Argentina">
<Nodes>
<ec:TreeNode Text="Buenos Aires " />
<ec:TreeNode Text="Cordoba" />
</Nodes>
</ec:TreeNode>
<ec:TreeNode Text="Chile">
<Nodes>
<ec:TreeNode Text="Arica" />
<ec:TreeNode Text="Copiapo" />
<ec:TreeNode Text="Puerto Montt" />
</Nodes>
</ec:TreeNode>
</Nodes>
</ec:TreeNode>
<ec:TreeNode Text="Africa">
<Nodes>
<ec:TreeNode Text="South Africa">
<Nodes>
<ec:TreeNode Text="Cape Town" />
<ec:TreeNode Text="Johannesburg" />
<ec:TreeNode Text="Pretoria " />
</Nodes>
</ec:TreeNode>
<ec:TreeNode Text="Zambia">
<Nodes>
<ec:TreeNode Text="Lusaka" />
</Nodes>
</ec:TreeNode>
<ec:TreeNode Text="Zimbabwe">
<Nodes>
<ec:TreeNode Text="Harare" />
</Nodes>
</ec:TreeNode>
</Nodes>
</ec:TreeNode>
</Nodes>
</ec:ExpertTree>
</td>
</tr>
</table>
</td>
<td valign="top" width="220">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td><asp:Button Runat="server" ID="GetCheckedNodes" Text="Get Checked Nodes"></asp:Button></td>
</tr>
<tr>
<td><asp:CheckBoxList Runat=server ID="CheckedNodes" DataSource='<%#CheckBoxesTree.CheckedNodes%>' AutoPostBack=False DataTextField="Path" Font-Names="Tahoma,Verdana,Arial" Font-Size="10"></asp:CheckBoxList></td>
</tr>
</table>
</td>
<td valign="top" style="PADDING-LEFT:10px">
<ecd:DescriptionView runat="server" ID="Descriptionview1">
<ecd:Description id="Description1" runat="server">
Set <b>CheckBoxes="true"</b> at the tree level if you want that ExpertTree
shows check boxes next to all nodes. You can assign check boxes for individual nodes
with the node's <b>IsCheckable</b> boolean property.
</ecd:Description>
<ecd:Description id="Description2" runat="server">
Use <b>AutoCheckChildren</b> and <b>AutoUnCheckChildren</b> properties for the tree to control
whether child nodes should be checked / unchecked if their parent node
is checked / unchecked.
</ecd:Description>
<ecd:Description id="Description3" runat="server">
Use <b>CheckedNodes</b> property of the ExpertTree to get the ArrayList of the
checked nodes.
</ecd:Description>
<ecd:Description id="Description4" runat="server">
Use <b>SpaceBar</b> key to check / uncheck the node while navigating across the tree with keyboard.
</ecd:Description>
</ecd:DescriptionView>
</td>
</tr>
</table>
<ec:CodeViewTab id="CodeViewTab1" runat="server">
<ec:TabItem runat="server" Text="aspx" ID="Tabitem1">
<pre class="aspcode">
<ecd:SyntaxHighlight runat="server" ContentType="ASPX" OutputFile="Programming/CheckBoxes.ascx" ID="Syntaxhighlight1"/>
</pre>
</ec:TabItem>
<ec:TabItem runat="server" Text="C#" ID="Tabitem2">
<pre class="aspcode">
<ecd:SyntaxHighlight runat="server" ContentType="C#" OutputFile="Programming/CheckBoxes.ascx.cs" ID="Syntaxhighlight2"/>
</pre>
</ec:TabItem>
<ec:TabItem runat="server" Text="VB" ID="Tabitem3">
<pre class="aspcode">
<ecd:SyntaxHighlight runat="server" ContentType="VB" OutputFile="Programming/CheckBoxes_vb.ascx.vb" ID="Syntaxhighlight3"/>
</pre>
</ec:TabItem>
</ec:CodeViewTab>