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

Treeview in combobox keyboard navigation?

3 Answers 56 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Amar
Top achievements
Rank 1
Amar asked on 02 Mar 2009, 10:50 AM
Hi, I am deciding whether to use the TreeViewCombobox method, as shown in the demos that come with telerik installation.

/TreeView/Examples/Functionality/TreeViewComboBox/DefaultCS.aspx

I need to ensure that the selection of treeeview item is possible through the keyboard. so far i have try navigating the treeview in the demo page but have not been successfull.

To expand the dropdown and make the treeview visible i use ALT + Down arrow key. This works. But then i cannot set focus to the treeview no matter what i do. Can anyone please tell me whether it is possible or any key combinations.

Thanks.

Amar

3 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 04 Mar 2009, 10:28 AM
Hi Amar,

Here is what you can do:

Set the AccessKey of the TreeView (e.g. AccessKey="I") and the TabIndex (e.g. TabIndex="2").

Now when you tab to the combobox and click on the Alt + Down array the dropdown will open. Now you can click on Alt + I to focus the treeview. Then you can use the down arrow to navigate the tree nodes.

I hope this helps.

Regards,
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
Vijay
Top achievements
Rank 1
answered on 16 Mar 2012, 09:51 PM
Hi,

I have the same issue as reported here. We have a RadComboBox, with an ItemTemplate containing only a RadTreeView. Is there some way to programatically move the keyboard focus to the tree when the drop down area is displayed? It seems like this should be easy to do, but I have not had any success yet. 

I've tried hooking the OnClientDropDownOpened event, which allows me to expand the tree and select items, but it does not move the keyboard focus to the treeview automatically. Is there any way to do this so our keyboard-only users do not need to learn another key combination for this?

   function RadCombo_OnClientDropDownOpened(sender, eventArgs) 
    {
        var tree = sender.get_items().getItem(0).findControl("RadTreeView1"); 
        tree.get_nodes().getNode(0).expand();
        tree.get_nodes().getNode(0).select();
        tree.focus();
    }

0
Dimitar Terziev
Telerik team
answered on 21 Mar 2012, 01:49 PM
Hi,

Try to change you implementation as following:
function RadCombo_OnClientDropDownOpened(sender, eventArgs) {
    var tree = sender.get_items().getItem(0).findControl("RadTreeView1");
    tree.get_nodes().getNode(0).expand();
    tree.get_nodes().getNode(0).select();
    tree.get_element().focus();
}

This should solve your problem.

All the best,
Dimitar Terziev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
TreeView
Asked by
Amar
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Vijay
Top achievements
Rank 1
Dimitar Terziev
Telerik team
Share this question
or