0
有什么方法可以遍历所有的the levels of treeview nodes
。如何循环遍历树视图的所有级别以根据某些条件隐藏某些节点?
我有一个树视图处理XML数据源:
<asp:TreeView ID="tv_products" runat="server" ImageSet="Events" DataSourceID="XmlDataSource1" OnSelectedNodeChanged="DirectoryTree_SelectedNodeChanged" ShowLines="True" OnDataBound="DirectoryTree_DataBound">
<DataBindings>
<asp:TreeNodeBinding DataMember="MenuItem" ImageUrl="~/images/folder.png" TextField="fullname" ValueField="maincode" ToolTipField="fullname" />
</DataBindings>
<ParentNodeStyle Font-Bold="False" />
<HoverNodeStyle Font-Underline="False" ForeColor="Red" />
<SelectedNodeStyle Font-Underline="True" Font-Bold="true" Font-Size="Small" HorizontalPadding="0px" VerticalPadding="0px" />
<NodeStyle Font-Names="Verdana" Font-Size="8pt" ForeColor="Black" HorizontalPadding="5px" NodeSpacing="0px" VerticalPadding="0px" /></asp:TreeView>
请一些例子,如果可能的吗?