Hittest

2 posts, 0 answers
  1. Kim
    Kim avatar
    47 posts
    Member since:
    Jul 2013

    Posted 29 Nov 2013 Link to this post

    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
  2. Dimitar
    Admin
    Dimitar avatar
    1404 posts

    Posted 02 Dec 2013 Link to this post

    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 >>
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top