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.

Up and Down Arrows in Edit Mode of Treeview Are Disabled

Thread ID:

Created:

Updated:

Platform:

Replies:

35181 Sep 25,2005 10:38 PM Sep 26,2005 06:45 AM Windows Forms 1
loading
Tags: Tools
Tim Harrington
Asked On September 25, 2005 10:38 PM

Is it possible to be able to use the up and down arrow keys to scroll through the treeview control while in edit mode. I simply want to be able to scroll through every node on the tree and have each node come up in edit mode as I hit the up and down arrow keys. When you leave the node, then the edit mode would be turned off. Unfortunately, there is no way of turning off and then turning on edit mode programmatically as you scroll thorugh the tree using the up and down arrows because the node label does not allow you to trap the keypress nor keydown events in .NET. You always have to either hit ''Enter'' or click on another node to get out of edit mode. Can someone help me?

Vijayanand S [Syncfusion]
Replied On September 26, 2005 06:45 AM

Hi Tim, You could navigate through the nodes in the TreeViewAdv control using the keyboard while in editing mode, by using the following code snippet: private void treeViewAdv1_BeforeEdit(object sender, Syncfusion.Windows.Forms.Tools.TreeNodeAdvBeforeEditEventArgs e) { //TempNode is the Holder of the current editing node TempNode=e.Node; TextBox t=e.TextBox; //KeyEventHandler to handle the Keys pressed in Text box t.KeyDown+=new KeyEventHandler(t_KeyDown); } private void t_KeyDown(object sender, KeyEventArgs e) { TextBox t=sender as TextBox; if(e.KeyData==Keys.Down) { //To Stop the editing this.treeViewAdv1.EndEdit(true); //To replace the edited contents into the selected node. TempNode.Text=t.Text; //End the event e.Handled=true; } } You could also start the node editing dynamically by using, this.treeViewAdv1.BeginEdit() method. Please take a look at the attached sample and let me know if this fulfills your requirement. Thanks for using Syncfusion products. Regards, Vijay f35181_6405.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.

;