Adam Fox
Adam Fox

Reputation: 1326

ASP.NET: Display Leaf Node as Parent within TreeView Control

Is is possible to display a node without children as a leaf node within the .NET 3.5 TreeView control?

I have a treeview that displays a list of companies as nodes which would each display leaf nodes for documents belonging to that company.

If a company exists without any documents I would still like it to be rendered as parent (folder) but it renders as a leaf (file).

I could add a "No Documents" node to the company but this seems ugly and would add overhead to manage whether or not the node is there or should be added.

There doesnt seem to be any properties on TreeNode that would help here

Any ideas?

Thanks

Upvotes: 0

Views: 1534

Answers (1)

Adam Fox
Adam Fox

Reputation: 1326

The only way I discovered to resolve this issue is to add a "No Document" leaf to any empty parent folder

Upvotes: 1

Related Questions