Click here to Skip to main content
15,917,176 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

Anybody is having any idea that how to disable the node of treeview?
Posted
Comments
R. Giskard Reventlov 18-Oct-11 5:43am    
What have you tried for yourself?
kiran dangar 19-Oct-11 2:37am    
Please elaborate the question by giving the code you have wrote

1 solution

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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900