This is a migrated thread and some comments may be shown as answers.

When i pressed F2 key for editing the node it will edit for second time Press or need to press and hold a sec

1 Answer 71 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Runjith
Top achievements
Rank 2
Runjith asked on 25 Jul 2014, 12:34 PM
Hi,

I have implemented Keyboard Functionality for rename,When i press F2 key for editing the node it will edit for second press or need to press and hold a sec.

Please find the below Code..

 void treeview_KeyDown(object sender, KeyEventArgs e)
        {
               if(e.Key==Key.F2)
                {
                    treeview.IsEditable = true;
                  //  e.Handled = true;
                }              
                }
       }
Please help me ASAP.

Regards,
Ranjith

1 Answer, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 30 Jul 2014, 06:08 AM
Hello Ranjith,

I noticed that you actually turn the feature of editing the RadTreeViewItems on every time you press F2. Please note that enabling this feature once is enough. Once enabled, you will be able to edit RadTreeViewItems by pressing F2 out of the box. This is why I suggest setting the RadTreeView.IsEditable property to True and unsubscribing from the KeyDown event of the RadTreeView.

Please give this approach a try and let us know if you need any further assistance.

Regards,
Pavel R. Pavlov
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
TreeView
Asked by
Runjith
Top achievements
Rank 2
Answers by
Pavel R. Pavlov
Telerik team
Share this question
or