0

I am using a tri state treeview, I want to be able to check check a parent only without checking all or part of its children or giving it Indeterminate state. I used this function but it is not working properly

private void treeSysFunctions_AfterCheck(object sender, TreeViewEventArgs e)
    {          
        if (!e.Node.Checked)
        {
            TreeNode parent = e.Node.Parent;
            if (parent != null)
            {
                bool hasCheckedChild = HasCheckedChild(parent);

                if (!hasCheckedChild)
                    treeSysFunctions.SetChecked(parent, Elegant.Ui.Extensions.TriStateTreeView.CheckState.Indeterminate);
            }
        }
    }
IbrahimZ
  • 1
  • 1
  • What is not working properly? What does it do currently and what do you expect it to do? Have you tried printing out the variables inside the function to debug? – SaeX Nov 22 '15 at 19:28
  • I want to change the state of the parent only, but actually all the children are also get the same state Indeterminate – IbrahimZ Nov 22 '15 at 19:40

0 Answers0