C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




How to select and deselect all the child nodes of a parent in tree view in C# .net


Posted Date: 24 Jul 2007      Total Responses: 1

Posted By: Shashi Bhushan Sharma       Member Level: Gold     Points: 2


Hello Friends

I have a tree view and i add the child node on the click its parent. Now i want when parent node is checked the all its child nodes are checked and if i uncheck the parent node then all the child nodes are unchecked. I do not want to use java script. Plz send me the code. it is uezent.

Thanks in advance

regads
Shashi




Responses

Author: M Asif    05 Sep 2007Member Level: BronzeRating:     Points: 2

private void treeView_AfterCheck(object sender, TreeViewEventArgs e)
{
if (e.Node.Nodes.Count != 0)
SetSelection (e.Node, e.Node.Checked);
}

private void SetSelection(TreeNode node, bool bCheck)
{
foreach (TreeNode n in node.Nodes)
{
n.Checked = bCheck;
SetSelection (n, bCheck);
}
}



Post Reply
You must Sign In to post a response.
Next : What is Webservice Namespace
Previous : about creation of DLL in Asp.net 2.0
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design

teleconferencing

Contact Us    Privacy Policy    Terms Of Use