We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Editing error in tree

Thread ID:

Created:

Updated:

Platform:

Replies:

44829 Jun 5,2006 05:43 AM Jun 5,2006 06:37 AM Windows Forms 1
loading
Tags: Tools
Administrator [Syncfusion]
Asked On June 5, 2006 05:43 AM

I use pop up menu with tree. Setting labeledit to true makes all the nodes to be in the editable mode if F2 is pressed. I want to edit the particular node only with pop up menu. Thanks in advance. Mari

Deepa TS [Syncfusion]
Replied On June 5, 2006 06:37 AM

Hi Mari, Thanks for using Syncfusion products. You can edit the particular node only with popup menu by using the popupMenusManager and by disabling the editing behavior once the editing operation is completed using TreeViewAdv NodeEditorValidated event. TreeNodeAdv editedNode = null; //Handling the TreeViewAdv''s MouseDown event in the following way,will help you in getting the selected node''s PopupMenu when right clicked. private void treeViewAdv1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) { if (e.Button == MouseButtons.Right) { // get the point where the mouse was right clicked Point p = this.treeViewAdv1.PointToClient(Control.MousePosition); // get the node at the right click point editedNode = this.treeViewAdv1.PointToNode(p); this.treeViewAdv1.SelectedNode=editedNode; } } //The TreeViewAdv''s BeginEdit method makes the selected node editable. private void barItem1_Click(object sender, EventArgs e) { if (this.editedNode != null) { this.treeViewAdv1.SelectedNode = this.editedNode; this.treeViewAdv1.LabelEdit = true; this.treeViewAdv1.BeginEdit(); } } //Disable the editable behavior ,once the editing operation is over. private void treeViewAdv1_NodeEditorValidated(object sender, Syncfusion.Windows.Forms.Tools.TreeNodeAdvEditEventArgs e) { this.treeViewAdv1.LabelEdit=false; } Please take a look at the attached sample and let me know if this helps you. Regards, Deepa

EditNode.zip

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;