Articles in this section
Category / Section

How to display check boxes for the nodes in WinForms TreeViewAdv?

2 mins read

Checkbox

You can control the display of check boxes for each TreeNodeAdv in the TreeViewAdv control using the TreeNodeAdv.ShowCheckBoxes property. The following code sample shows how to display check boxes only for the first level of child nodes below the parent node:

C#

//Show Checkbox only for the first level of child nodes
int i = 0;
while (i < this.treeViewAdv1.Nodes.Count)
{
    int j = 0;
    while (j < this.treeViewAdv1.Nodes[i].Nodes.Count)
    {
        this.treeViewAdv1.Nodes[i].Nodes[j].ShowCheckBox = true;
        j++;
    }
    i++;
}

VB

'Show Checkbox only for the first level of child nodes
Dim i As Integer = 0
While i < Me.treeViewAdv1.Nodes.Count
    Dim j As Integer = 0
    While j < Me.treeViewAdv1.Nodes(i).Nodes.Count
        Me.treeViewAdv1.Nodes(i).Nodes(j).ShowCheckBox = True
        j = j + 1
    End While
    i = i + 1
End While

Reference link: TreeNodeAdv customization for checkbox


Conclusion

I hope you enjoyed learning about how to display check boxes for the nodes in WinForms TreeViewAdv.

You can refer to our WinForms TreeView feature tour page to know about its other groundbreaking feature representations. You can also explore our  WinForms TreeView documentation to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!


Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied