[英]How to generate a treeview in ASP.NET?
ASP.NET does have a TreeView
control that you can use to display a Treeview very similar to the one you show. ASP.NET确实具有一个
TreeView
控件 ,可用于显示与您所显示的非常相似的Treeview。
If you require the Checkboxes
on each and every Treeview node, but sure to set the ShowCheckBoxes
attribute to the appropriate setting (ie ShowCheckBoxes="All"
> 如果您在每个Treeview节点上都需要
Checkboxes
,但是请确保将ShowCheckBoxes
属性设置为适当的设置(即ShowCheckBoxes="All"
>
Regarding the nodes themselves, you can bind the TreeView
to a DataSource
which can either be an ASP.NET SiteMap
file or an XML Document. 关于节点本身,可以将
TreeView
绑定到DataSource
,该DataSource
可以是ASP.NET SiteMap
文件或XML文档。 Alternatively, you can programmatically add the nodes yourself in code like so: 另外,您可以自己以编程方式在代码中添加节点,如下所示:
TreeNode tn = new TreeNode();
tn.Value = "Cities";
TreeView1.Nodes.Add(tn);
tn.ChildNodes.Add(new TreeNode("Cochin 1"));
[etc. etc.]
Some other useful links are: 其他一些有用的链接是:
Using the TreeView Control and a DataList to Create an Online Image Gallery 使用TreeView控件和DataList创建在线图像库
ASP.NET Treeview Quickstart Tutorial ASP.NET Treeview快速入门教程
使用asp.net treeview,看看这里一切都解释了
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.