.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> C# >> Post New QuestionBookmark and Share Subscribe to Forum

Treeview AfterCheck Event

Posted By: kamlesh     Posted Date: January 06, 2012    Points:5   Category :C#
I have write below code on treeview(with checkbox) aftercheck event
when i check it give me that if uncheck that check item it gives me error

GetAllChecked : is function for getting checked item.


An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll

int iz = 0;
foreach (TreeNode otree in e.Node.Nodes)
{
otree.Checked = e.Node.Checked;
CheckName(otree, e.Node.Checked);
iz = 1;
}
if (e.Node.Parent != null)
{
if (e.Node.Checked == false)
{
e.Node.Parent.Checked = e.Node.Checked;
CheckParent(e.Node.Parent);
}
}

lstRightBackup.Items.Clear();
for (int i = 0; i < treeview.Nodes.Count; i++)
GetAllChecked(treeview.Nodes[i]);
return;
}

Responses
Author: Sasi Prabhu             
Posted Date: January 06, 2012     Points: 20   
Author: Clintonzz             
Posted Date: February 26, 2014     Points: 20   

In speaking of TreeView, you may interested in some UI TreeView Control:

http://www.kettic.com/winforms_ui/treeview.shtml



Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend