asp treeview checkboxlist

Posted on 2012-08-28
Last Modified: 2012-08-30
hey guys i have a treeview with checkboxlist. my problem is when i deselect a child node and if they if no other child node selected the parent node must be deselected.

i have code this so if the user select a parent all child be selected

here my code

    protected void TreeView_TreeNodeCheckChanged(object sender, TreeNodeEventArgs e)
        if (e.Node.ChildNodes.Count > 0)
            if (e.Node.Checked)
                ChangeChecked(e.Node, true);
                ChangeChecked(e.Node, false);
        else if (e.Node.Parent != null)
            e.Node.Parent.Checked = true;

    private void ChangeChecked(TreeNode node, bool check)
        if (node.ChildNodes.Count > 0)
            for (int i = 0; i < node.ChildNodes.Count; i++)
                ChangeChecked(node.ChildNodes[i], check);

        node.Checked = check;

Open in new window

Question by:JCWEBHOST
    1 Comment
    LVL 23

    Accepted Solution


    Check this ASP.NET Forum thread -

    It is solved using JavaScript!

    Hope it helps u...

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
    Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now