如何在树状视图中禁用节点 [英] How to disable Nodes in tree view
本文介绍了如何在树状视图中禁用节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人知道如何禁用树视图的节点吗?
Hi,
Anybody is having any idea that how to disable the node of treeview?
推荐答案
kjs,
我认为您还没有尝试过任何事情.尝试使用Visual Studio提供的至少默认方法和选项.
无论如何,这就是答案
aspx页面:
< asp:TreeView ID ="tvProdVars" runat ="server" ExpandDepth ="0"
>
< LeafNodeStyle CssClass ="listbox"/>
< DataBindings>
< asp:TreeNodeBinding TextField ="test" DataMember ="test" SelectAction ="None"></asp:TreeNodeBinding>
< asp:TreeNodeBinding TextField ="test" ValueField ="Id" DataMember ="test"></asp:TreeNodeBinding>
</DataBindings>
</asp:TreeView>
SelectAction ="None"将禁用相应的treenode.
后面的代码也可以做同样的事情
希望这会有所帮助.
Hi kjs,
I think you haven''t tried anything on you own. Try atleast default methods and options given to you by visual studio.
Anyway here is the answer
aspx page:
<asp:TreeView ID="tvProdVars" runat="server" ExpandDepth="0"
>
<LeafNodeStyle CssClass="listbox" />
<DataBindings>
<asp:TreeNodeBinding TextField="test" DataMember="test" SelectAction="None"></asp:TreeNodeBinding>
<asp:TreeNodeBinding TextField="test" ValueField="Id" DataMember="test" ></asp:TreeNodeBinding>
</DataBindings>
</asp:TreeView>
SelectAction="None" will disable the corresponding treenode.
Code behind also you do the same thing
Hope this helps.
这篇关于如何在树状视图中禁用节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文