capture DoubleClick or Click event

5 posts, 0 answers
  1. Matt
    Matt avatar
    3 posts
    Member since:
    Aug 2008

    Posted 04 Jul 2009 Link to this post

    .NET 3.5

    RadControls for WinForms Q1 2009 SP1
    MS Visual Studio 2008

    I have been able to do just about everything else I need to do in the Treeview control, except capturing click events in my form. The tree is generated from SQL tables and otherwise appears fine. Ultimately I am hoping to wire the tree nodes to files in the filesystem.
    Following is the code to capture the DoubleClick event (copied from documentation):



    Sub RadTreeView1_DoubleClick(ByVal sender As Object, ByVal e As EventArgs)




    Dim args As MouseEventArgs = TryCast(e, MouseEventArgs)




    Dim clickedNode As RadTreeNode = RadTreeView1.GetNodeAt(args.X, args.Y)




    If clickedNode <> Nothing Then





        MessageBox.Show("Node Text: " + clickedNode.Text + " Node Value: " + clickedNode.Tag)




    End If





    End Sub







    The only other block of code in my form is my form load which loads the tree with data from the database.

    I have 2 questions/problems:
    1. Visual Studio is complaining about the IF statement: "Operator '<>' is not defined for types 'Telerik.WinControls.UI.RadTreeNode' and 'Telerik.WinControls.UI.RadTreeNode'. What does this mean?
    2. It appears the DoubleClick event isn't being captured since nothing happens when I double click a node. Is the IF statement error related to this? What am I missing? For my testing I simply commented out the 'If...' and 'End If' lines.

    Thanks in advance for any guidance you can provide.

  2. Matt
    Matt avatar
    2 posts
    Member since:
    May 2009

    Posted 06 Jul 2009 Link to this post

    I found samples that do what I need to do.

    Sorry for the inconvenience.
  3. scottw
    scottw avatar
    23 posts
    Member since:
    Oct 2010

    Posted 02 Jan 2012 Link to this post

    I am also having problems having my double click event actually captured. I have both a DoubleClick event and a MouseDoubleClick event, and either both of them get captured, or neither of them do. Double clicking really, really fast mostly doesn't work, though curiously clicking the left and right mouse buttons in quick succession seems more likely to fire the event/

    Where did you find your solution?

  4. Matt
    Matt avatar
    2 posts
    Member since:
    May 2009

    Posted 04 Jan 2012 Link to this post

    In my case the problem was incorrectly calling the event handler, which was really a VS/VB problem. Instead of letting VS "create" the handlers for me I was hand coding them, and I had incorrectly called out the handler.

    Since then, I learned how to create the handlers in VS the "VS way" which has eliminated many headaches for me.

    FWIW, I have discovered that, while the Telerik tree control functions as advertised, it can be finicky.

    Hope that helps you.
  5. Stefan
    Stefan avatar
    2911 posts

    Posted 05 Jan 2012 Link to this post

    Hello Scott,

    I have performed some tests and both DoubleClick and MouseDoubleClicked events are fired correctly. Furthermore, if you double click a node, the NodeMouseDoubleClick is triggered too. Attached is a sample application.

    If you are aware of a case, where those events are not fired, please provide me with details describing how to reproduce this case, or open a support ticket, where you can attach sample project demonstrating the undesired behavior. Once we are able to replicate such a behavior, we will take the necessary actions in order to address it. 

    I hope this helps.

    the Telerik team

    of Q3’11 of RadControls for WinForms is available for download (see what's new).
Back to Top