Hello Lakshmi,
Thank you for you answer.
However I was able to fix-it via little workaround:
TreeView.CheckBoxMode = CheckBoxMode.None;
SetNodesCheckBox(TreeView.Nodes);
...
private void SetNodesCheckBox(TreeViewNodeCollection nodes)
{
foreach (var node in nodes)
{
if (node.HasChildNodes)
SetNodesCheckBox(node.ChildNodes);
if (node.ParentNode == null)
break;
if (node.ParentNode.ChildNodes.All(x => x.IsChecked.GetValueOrDefault(false)))
{
node.ParentNode.IsChecked = true;
break;
}
if (node.ParentNode.ChildNodes.Any(x => x.IsChecked.GetValueOrDefault(true)))
node.ParentNode.IsChecked = null;
if (!node.HasChildNodes)
break;
}
}
...
TreeView.CheckBoxMode = CheckBoxMode.Recursive;
Of course it would be better to have this working properly out of the box.