[RESOLVED] Treeview: Disable a node from being able to be selected
I know treeview has issues with checkboxes, so I need to know if there is a way to disable a node and a node item from being able to be selected at all (but stay visible). There is no enable/disable property so how can one achieve this?
Re: Treeview: Disable a node from being able to be selected
This is really a shot in the dark, but have you looked at the vbAccelerator TreeView? I havn't actually used it myself, but there is a good chance it has an enable/disable property.
Re: Treeview: Disable a node from being able to be selected
I would do it by setting the SelectedItem property to Nothing when the "disabled" node is clicked.
If you are using icons on your nodes, you could also visually indicate that a node is "disabled" by using a different icon for that node (i.e., a gray-scale version of the normal icon you would use for an "enabled" node).
Re: Treeview: Disable a node from being able to be selected
Well, what I am attempting to do is to avoid the checkbox being checked at all. If you can click on the node it will toggle the checkbox regardless. I want to avoid the checkbox being checked at all.
Re: Treeview: Disable a node from being able to be selected
Re: Treeview: Disable a node from being able to be selected
MartinLiss,
Yes, that did the trick soon as I figured out how and why it worked. Exactly what I needed to accomplish. Thanks.
Re: Treeview: Disable a node from being able to be selected
Quote:
Originally Posted by
randem
MartinLiss,
Yes, that did the trick soon as I figured out how and why it worked. Exactly what I needed to accomplish. Thanks.
I a, trying to do the same thing but the link he posted above does not work. I am looking to do this exact same thing. Any help would be appreciated.
Re: Treeview: Disable a node from being able to be selected
After 11 years I'm not surprised. I don't remember what I was pointing to but this https://matteo72.wordpress.com/2013/...oxes-in-nodes/ gives a solution. The If Node.Tag = "DISABLED" Then line could be changed to If Node.Text = "blah" Then, etc.