[SOLVED] TreeNode disable Label editing

Answered Closed
0
0

Hi guys,

I have hooked Insert and Delete keydown on a treenode to Add sub-node on this node and delete the node itself. I can cancel the operation for certain nodes (in effect disable insert and delete for those nodes) in the keydown event.

On the other hand, for editing the node label, there is already  built in the functionality to start editing with a. either F2 or b. two clicks with a short delay between them. And there is the problem. How can I cancel (disable) editing for certain nodes? As soon as they receive F2 or the two delayed clicks they go into editing mode.

Best,
Alex

  • You must to post comments
Best Answer
0
0

Yes, it’s full of spam. 🙂

  • You must to post comments
0
0

Thanks, Luca, that did the trick! I was using BeforeLabelEdit and I was returning if I was on the node I want to cancel edit for, had not seen the e.CancelEdit.

Best,
Alex

PS. Have u checked your spam folder lately? 🙂

  • You must to post comments
0
0

Hi Alex,

Did you try TreeView.OnBeforeLabelEdit? You can set CancelEdit = true to prevent edit mode.

Best,

Luca

  • You must to post comments
Showing 3 results