//head Jquery for check and uncheck <script> $(document).ready(function () { $("div[class $= t1] input[type=checkbox]").click(function () { $(this).closest("table").next("div").find("input[type=checkbox]").attr("checked", this.checked); }); }); </script> //body <asp:TreeView ID="treeviwExample" class="t1" ShowCheckBoxes="All" runat="server" ImageSet="Arrows"> <HoverNodeStyle Font-Underline="True" ForeColor="#5555DD" /> <Nodes> <asp:TreeNode Text="Root" Value="Root"> <asp:TreeNode Text="Parent1" Value="Parent1"> <asp:TreeNode Text="Leaf 1" Value="Leaf 1"></asp:TreeNode> <asp:TreeNode Text="Leaf 2" Value="Leaf 2"></asp:TreeNode> </asp:TreeNode> <asp:TreeNode Text="Parent2" Value="Parent2"> <asp:TreeNode Text="Leaf 1" Value="Leaf 1"></asp:TreeNode> <asp:TreeNode Text="Leaf 2" Value="Leaf 2"></asp:TreeNode> </asp:TreeNode> </asp:TreeNode> </Nodes> <NodeStyle Font-Names="Verdana" Font-Size="8pt" ForeColor="Black" HorizontalPadding="5px" NodeSpacing="0px" VerticalPadding="0px" /> <ParentNodeStyle Font-Bold="False" /> <SelectedNodeStyle Font-Underline="True" ForeColor="#5555DD" HorizontalPadding="0px" VerticalPadding="0px" /> </asp:TreeView> <asp:TreeView ID="TreeViewSelectedData" runat="server"> </asp:TreeView>
Root Parent 1 Leaf 1 Leaf 2
Root Parent 1 Leaf 1 Leaf 2 Parent 2 Leaf 1 Leaf 2
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)