Change focus on node select

2 posts, 0 answers
  1. Alexander
    Alexander avatar
    1 posts
    Member since:
    Dec 2014

    Posted 10 Mar 2015 Link to this post


    I want to select a control in my form when the user selects a node.
    This works when selecting the node with the keyboard but when i select a node with the mouse, the node gets the focus after the SelectedNodeChanged event.
    Is there any way to tell the Treeview not to steal the focus?
  2. Todor Vyagov
    Todor Vyagov avatar
    31 posts

    Posted 12 Mar 2015 Link to this post

    Hello Alexander,

    Thank you for writing.

    When you click the node of RadTreeView as you mentioned the focus is set after the SelectedNodeChanged event is fired. To set the focus to other control after the mouse is clicked you can subscribe to the MouseUp event.
    private void radTreeView1_SelectedNodeChanged(object sender, RadTreeViewEventArgs e)
        string nodeText = e.Node.Text;
    private void radTreeView1_MouseUp(object sender, MouseEventArgs e)
        if (this.radTreeView1.SelectedNode == null)
        string nodeText = this.radTreeView1.SelectedNode.Text;
    private void SetFocusToControl(string nodeText)
        if (nodeText == "RadButton")
        else if (nodeText == "RadDropDownButton")

    I hope this information helps.

    Todor Vyagov

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

  3. DevCraft R3 2016 release webinar banner
Back to Top