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

node is selected but cursor keys do not control selection

1 Answer 21 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
ali
Top achievements
Rank 1
ali asked on 24 Feb 2009, 05:23 PM
Hi,
I am setting the node.set_selected(true); but I am finding that although the node is selected, the treeview keyboard navigation is lost. I have to click on it again to get it working. This is not convenient when you navigate to a node press f2 to rename and then find you have to use the mouse again.

Can you please tell me how to solve this. Thanks

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 25 Feb 2009, 01:57 PM
Hello ali,

After renaming RadTreeView normally postsback. After postback (or if you have ajaxified it - ajax) the focus is lost hence RadTreeView does not respond to key presses. As a workaround you can use the following code:

protected void Page_Load(object sender, EventArgs e)
{
    ScriptManager.RegisterStartupScript(this,GetType(), "focusTreeView",
        string.Format("Sys.Application.add_load(function(){{$find('{0}').get_element().focus();}});",
        RadTreeView1.ClientID), true);
}

Regards,
Albert
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.
Tags
TreeView
Asked by
ali
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or