Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Treeview > capture DoubleClick or Click event

Not answered capture DoubleClick or Click event

Feed from this thread
  • Matt avatar

    Posted on Jul 4, 2009 (permalink)

    VB.NET
    .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):

    Private

     

    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.
    Matt

    Reply

  • Matt avatar

    Posted on Jul 6, 2009 (permalink)

    I found samples that do what I need to do.

    Sorry for the inconvenience.

    Reply

  • scottw avatar

    Posted on Jan 2, 2012 (permalink)

    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?


    Thanks

    Reply

  • Matt avatar

    Posted on Jan 4, 2012 (permalink)

    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.
    Matt

    Reply

  • Stefan Stefan admin's avatar

    Posted on Jan 5, 2012 (permalink)

    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.

    Greetings,
    Stefan
    the Telerik team

    SP1
    of Q3’11 of RadControls for WinForms is available for download (see what's new).
    Attached files

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Treeview > capture DoubleClick or Click event
Related resources for "capture DoubleClick or Click event"

[ Features | Demos | Documentation | Knowledge Base | Telerik TV | Code Library | Step-by-step Tutorial | Blogs | Self-Paced Trainer ]