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

Hittest

1 Answer 55 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
Kim
Top achievements
Rank 1
Kim asked on 29 Nov 2013, 07:39 PM
Hi,

On the mouse down event, i want to determine if they are over a node. In other products there was a hittest(x,y) method but i don't see one in your latest control. Am i missing somthing?

Kim

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 02 Dec 2013, 02:13 PM
Hello Kim,

Thank you for writing.

You can get the RadTreeNode in the mouse down event very easy like this:
void radTreeView1_MouseDown(object sender, MouseEventArgs e)
{
    RadTreeNode node = radTreeView1.GetNodeAt(e.Location);
 
    if (node != null)
    {
         RadMessageBox.Show(node.Text);
    }
}

Also if you prefer you can subscribe to the NodeMouseDown event where you can get the node directly:
void radTreeView1_NodeMouseDown(object sender, RadTreeViewMouseEventArgs e)
{
    RadMessageBox.Show(e.Node.Text);
}

I hope this will be useful. Should you have further questions, I would be glad to help.

Regards,
Dimitar
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
Treeview
Asked by
Kim
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or