GetNodeFromPoint brings back wrong node

Answered (Verified) This post has 1 verified answer | 4 Replies | 2 Followers Thread's RSS feed.

phenty
Points 30
Replied On: Sat, Aug 22 2009 8:40 AM Reply

I'm getting some strange behaviour when getting a node back using GetNodeFromPoint().

It's bringing back the wrong node.  Here is the result of two commands I typed into the immediate window to prove the point...

? pointInTree
{X = 79 Y = 335}
    IsEmpty: false
    X: 79
    Y: 335

? this.Tree.GetNodeFromPoint(pointInTree).Bounds
{X = 1 Y = 301 Width = 479 Height = 20}
    Bottom: 321
    Height: 20
    IsEmpty: false
    Left: 1
    Location: {X = 1 Y = 301}
    Right: 480
    Size: {Width = 479 Height = 20}
    Top: 301
    Width: 479
    X: 1
    Y: 301

As you can see the Point I passed in is not within the resulting node.  The resulting node goes from a Y of 301 to 321.  The point I passed in has a Y of 335 which would be the node underneath the one I got back.

Under what circumstances could this method bring back the wrong node?

Thanks,

 

Paul

 

  • Post Points: 5

Verified Answer

Answered (Verified) Replied On: Mon, Aug 24 2009 11:52 AM Reply
Verified by phenty

Hi Paul, 

I'm pretty sure this is a known bug that was fixed a long time ago. Try getting the latest service release:

How to get the latest service release - Infragistics Community

Mike Saltzman

Manager - Windows Forms Development

Infragistics, Inc.

  • Post Points: 55

All Replies

phenty
Points 30
Replied On: Sat, Aug 22 2009 11:36 AM Reply

After further investigation the node being returned is the correct node. 

The problem is that the .Bounds.Y coordinates for the node does not take into account any column headers displayed in the TreeView.  So the reported Y value is less that it should be, the difference being the height of all the column headers displayed above it. 

I'm using a pretty old version though (7.3.20073.38).  Maybe this has been changed in later versions.

I've used the UltraTreeNode.UIElement.Rect property instead and that is correct.

 

Paul

  • Post Points: 20
Answered (Verified) Replied On: Mon, Aug 24 2009 11:52 AM Reply
Verified by phenty

Hi Paul, 

I'm pretty sure this is a known bug that was fixed a long time ago. Try getting the latest service release:

How to get the latest service release - Infragistics Community

Mike Saltzman

Manager - Windows Forms Development

Infragistics, Inc.

  • Post Points: 55
phenty
Points 30
Replied On: Mon, Aug 24 2009 12:27 PM Reply

Will do.  Thank-you.

 

Paul

  • Post Points: 5
Jezze
Points 110
Replied On: Wed, Jan 25 2012 2:20 AM Reply

I also use a TreeView with Grid as view style and ran into the same problem, that headers are not counted into the Y coordinate of the node's bounds. The Rectangle of the UIElement returns the correct value.

I'm using Infragistics2.Win.UltraWinTree 11.2.20112.2004.

  • Post Points: 5
Page 1 of 1 (5 items) | RSS