I need a treeview control:
- Root nodes don't have checkboxes, only images.
- All child nodes have a checkbox + image.
C#, .net 2.0, winforms (not wpf)
The WinForms tree view does not support mixed checkbox/non checkboxes nodes by default
You can enable CheckBoxes globally on the tree view and disable them on specific nodes using this method
You can disable checkbox. First Set TreeView DrawMode property as OwnerDrawAll. Then Under DrawNode method check child node collection and set checked property as false ie.
private void xmlStructureTree_DrawNode(object sender, DrawTreeNodeEventArgs e)
{
if (e.Node.Nodes.Count != 0)
{
e.Node.Checked = false;
}
e.DrawDefault = true;
}