Problem with infragistics ultratree contextmenu

  • 10 years ago

    Hi,

    I am using an infragistics UltraTree control in Windows Application.

    I added context menu to it. When I right clicked on any node, I want to get the node at that point to displya the relevent information of that node. So I wrote the below code for that

    Private Sub tvXML_MouseUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles tvXML.MouseUp

    Dim newTreeNode As UltraTreeNode

    newTreeNode = tvXML.GetChildAtPoint(

    New Point(e.X, e.Y))

    DisplayInfo(newTreeNode)

    End Sub

    But, GetChildAtPoint() function always returns Nothing. so, I get nothing displayed.

    Please let me know if the way I am doing is correct.

    Thanks in advance.

    Vijay

  • 10 years ago

    I got the solution for this.

    I must use GetNodeFromPoint()  instead of GetChildAtPoint()

    Thanks,

    Vijay

  • 10 years ago
    Well I know for the standard TreeView control you use the method 'GetNodeAt' to retrieve the node at a given point.  It also has a method 'GetChildAtPoint' but this retrieves child controls not nodes.  Perhaps the UltraTree works the same way.  I'd look for a method 'GetNodeAt'.  If you are in fact using the correct method then I'm not sure what to tell you.  The basic logic and code looks fine to me.  Perhaps it's a bug with there control.  You might be better off going to them for support.
  • 10 years ago

    I was just a little late :)  Glad you got it figured out.

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“There are 10 types of people in the world, those who can read binary, and those who can't.”