node is selected but cursor keys do not control selection

2 posts, 0 answers
  1. ali
    ali avatar
    17 posts
    Member since:
    Jan 2009

    Posted 24 Feb 2009 Link to this post

    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

  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 25 Feb 2009 Link to this post

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