I'm trying to use the FindDiagramItemsInRect method to identify nodes that intersect connections to avoid a node from appearing on top (or overlaying) a connection while arranging the items in my custom layout. I've tried adjusting the rect that I pass to that function, but, it never returns any results.
Here's how I am calling it: diagram.FindDiagramItemsInRect(Of DiagramConnection)(New Windows.Rect(xpos,ypos,width,height)
Does it only return items that are fully enclosed by the rect? The documentation indicates that it includes intersections, but, that doesn't seem to be the case for me.
Any ideas?
It should be working as you would expect it to. Which version of the XamDiagram are you using? 14.1 or 14.2?
I have attached a sample using the 14.2 version and everything seems to be working.
Please include the exact version number of the Infragistics assemblies if you can.
No problem. Glad you got it working.
Ah... yes. The connections were not rendered. I had called the RefreshLayout in the constructor of my inherited Diagram class.
Sorry for the confusion, but, thank you for the assistance.
I'd have to see the application running to be able to know for sure, but if the Find method doesn't work then I would imagine that either the DiagramItem.Bounds property hasn't been set or possibly the node has not been rendered yet (and maybe that's why the Bounds haven't been set?). I think the main thing is the Bounds property. You can check to see if they are set by looking at the XamDiagram.Items collection.
I'm using assembly 14.2.20142.2081
But, I figured it out (sort of). I was using that method inside of my custom IDiagramLayout ArrangeNodes sub. Even though the connections already existed in the diagram prior to calling the RefreshLayout method, for some reason the Find... method called within that routine didn't return anything. But, when I moved it to my diagram's LayoutUpdated event, it worked as expected.