Hi Yordon,
Thanks for contacting Syncfusion support.
We have checked your reported query about show/hide the TreeView node. Currently , we have not provided API for hide the TreeView node. However, we can achieve your requirement in unique work around approach. In TreeView component, we have provided a method EnableNodes() and DisableNodes(). When calling this method, we have internally added the unique class to the specific treeview node element. Based on this class we can customize the element visibility to meet your requirement.
To perform this, you can pass the array of id (node id) in this method and also set the display as none for disable node in CSS level.
Refer the below code snippet.
public void DisableNode(System.EventArgs args)
{
tree.DisableNodes("['3']");
}
public void EnableNode(System.EventArgs args)
{
tree.EnableNodes("['3']");
}
<style>
#treeview .e-list-item.e-disable > .e-fullrow,
#treeview .e-list-item.e-disable > .e-text-content {
display: none;
}
</style> |
We have prepared a sample for your reference. In that sample, we can show and hide the node using button click.
To know more about the TreeView component, Refer the below links.
Please let us know, if you have any concerns.
Regards,
Sowmiya.P