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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Up and Down Arrows in Edit Mode of Treeview Are Disabled

Thread ID:





35181 Sep 26,2005 02:38 AM UTC Sep 26,2005 10:45 AM UTC WinForms 1
Tags: Tools
Tim Harrington
Asked On September 26, 2005 02:38 AM UTC

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 10:45 AM UTC

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


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon