Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

How can I expand and collapse the child nodes when the parent node is selected using JavaScript’s /Jquery.

$
0
0

How can I expand and collapse the child nodes when the parent node is selected using JavaScript’s /Jquery.

<asp:TreeView ID="tv1" runat="server" ShowCheckBoxes="All">

<Nodes>
<asp:TreeNode Text="New Node1" Value="New Node1">
<asp:TreeNode Text="New Node2" Value="New Node2">
<asp:TreeNode Text="New Node2.1" Value="New Node2.1"></asp:TreeNode>
<asp:TreeNode Text="New Node2.2" Value="New Node2.2"></asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode Text="New Node8" Value="New Node2">
<asp:TreeNode Text="New Node8.1" Value="New Node2.1"></asp:TreeNode>
<asp:TreeNode Text="New Node8.2" Value="New Node2.2"></asp:TreeNode>
</asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode Text="New Node3" Value="New Node3">
<asp:TreeNode Text="New Node4" Value="New Node4"></asp:TreeNode>
<asp:TreeNode Text="New Node5" Value="New Node5"></asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode Text="New Node6" Value="New Node6">
<asp:TreeNode Text="New Node7" Value="New Node7"></asp:TreeNode>
<asp:TreeNode Text="New Node8" Value="New Node8"></asp:TreeNode>
<asp:TreeNode Text="New Node9" Value="New Node9"></asp:TreeNode>
</asp:TreeNode>
</Nodes>
</asp:TreeView>

Here in my example if we check the check box New Node1 then 2 child node's need to expand.

                ->New Node2

                ->New Node8

 If we  Unchecked the New Node1   the view needs to be collapsed.

Any help is appreciated. Thank you for all the Help.

 


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>