Keyboard navigation broken after client edit

3 posts, 0 answers
  1. MikeWiese
    MikeWiese avatar
    43 posts
    Member since:
    Apr 2007

    Posted 21 Apr 2009 Link to this post

    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. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 23 Apr 2009 Link to this post

    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.
  3. MikeWiese
    MikeWiese avatar
    43 posts
    Member since:
    Apr 2007

    Posted 23 Apr 2009 Link to this post

    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!
Back to Top