ASP.NET:在 TreeView 控件中将叶节点显示为父节点
是否可以在 .NET 3.5 TreeView 控件中将没有子节点的节点显示为叶节点?
我有一个树视图,将公司列表显示为节点,每个节点都会显示属于该公司的文档的叶节点。
如果一家公司没有任何文档,我仍然希望将其呈现为父级(文件夹),但它呈现为叶(文件)。
我可以向公司添加一个“无文档”节点,但这看起来很难看,并且会增加管理该节点是否存在或是否应该添加的开销。
TreeNode 上似乎没有任何属性可以帮助这里
有什么想法吗?
谢谢
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现解决此问题的唯一方法是向任何空父文件夹添加“无文档”叶
The only way I discovered to resolve this issue is to add a "No Document" leaf to any empty parent folder