andreas_rafn
asked on
How can I disable selection of a TreeNode in a TreeView in VB.NET?
I'm currently implementing a navigation menu using a TreeView control.
In the menu I'm using headers (root nodes) to group menu items. These headers should only have one purpose: double-click collapse/uncollapse. For this reason it should'nt be possible to select and mark the node, but as default this is possible. What can I do to avoid that the headers can be selected? And is there a way to do this by setting TreeNode properties so that selection events doesn't have to be handled?
In the menu I'm using headers (root nodes) to group menu items. These headers should only have one purpose: double-click collapse/uncollapse. For this reason it should'nt be possible to select and mark the node, but as default this is possible. What can I do to avoid that the headers can be selected? And is there a way to do this by setting TreeNode properties so that selection events doesn't have to be handled?
Are you using Windows Forms or Web Forms?
ASKER
Windows Forms (System.Windows.Forms.Tree View)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hehe...guess I'm 20 seconds too late! =)
ASKER
The fastest submitter gets a little more :) The approach seems good, I'll try to combine it with a handling of the selection color so that the temporary selection will be invisible.