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

Keyboard navigation broken after client edit

2 Answers 60 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
MikeWiese
Top achievements
Rank 1
MikeWiese asked on 21 Apr 2009, 06:57 AM
Hi all

I'm trying to get a treeview control working with the keyboard, and I'm finding that after editing a node (via the F2 key) the keyboard navigation is broken.  I can reproduce this with a simple statically-defined treeview with AllowNodeEditing set to true:

    <telerik:RadTreeView ID="tree"  Runat="server" AllowNodeEditing="true">  
        <Nodes> 
            <telerik:RadTreeNode runat="server" Text="TopLevelA"></telerik:RadTreeNode> 
            <telerik:RadTreeNode runat="server" Text="TopLevelB"></telerik:RadTreeNode> 
            <telerik:RadTreeNode runat="server" Text="TopLevelC"></telerik:RadTreeNode> 
        </Nodes> 
    </telerik:RadTreeView> 
 

Selecting a node and hitting F2 puts a node into edit mode, and hitting Enter exits from edit mode. However, after exiting from edit mode in this manner, the arrow keys no longer server to move the selection indicator up and down. Once it gets into this state, you can get out of it by clicking the treeview with the mouse, but until you do this the arrow keys don't work. This pretty much defeats the purpose of using keyboard navigation in my application and changes the treeview from a thing of beauty to a thing of aggravation and angst, at least for for keyboard users and repetitive data-entry personnel.

Are there any hacks or workarounds for this? I'm using version 2009.1.402.35

Mike

2 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 23 Apr 2009, 01:58 PM
Hi MikeWiese,

Please set the TabIndex property of the TreeView (e.g. TabIndex="1").

Now, when you tab and the treeview is on focus - click the down arrow to select a node. Click F2 to edit it and enter to save the change. Now click again on the Tab button to focus the treeview - once focused you can use the arrows to move between nodes.

All the best,
Veselin Vasilev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
MikeWiese
Top achievements
Rank 1
answered on 23 Apr 2009, 02:49 PM
Thanks Veselin,

With your tip about the TabIndex, we can go one step further. I'm running
        var treeview = $find("<%= MyTreeCtl.ClientID %>");  
        treeview.get_element().focus();  
        treeview.get_element().setActive();  
 
in the OnClientNodeEdited handler, and now I don't even have to use the Tab key. The arrow keys, my OnClientKeyPressing handler all now work as soon as I finish editing a node via the Enter key - it's just what I wanted. Thank you!
Tags
TreeView
Asked by
MikeWiese
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
MikeWiese
Top achievements
Rank 1
Share this question
or