tags:

views:

57

answers:

1

Hi

I have a treeview control. I just want the user to edit the text of a node for the some specified nodes alone.

In treeview control i have labeledit property which makes the text editable for all nodes in the tree but i want only the corresponding node text to be editable..

Some thing like

treeview1.nodes[1].edit=true........

Anyway to do it...

Thanks in advance.

+1  A: 

Your best bet is to keep LabelEdit set to true on your TreeView, but catch the BeforeLabelEdit event and set e.CancelEdit to true whenever the user attempts to edit a node unless you want to allow it.

To programmatically initiate an edit on a node, you can use TreeNode.BeginEdit().

Matt Hamilton