TreeView Hit-Testing issue...
-
Trying to do some hit-testing in a TreeView. This control is *such* a pita to deal with. Say the tree is: 1 -2 -3 -4 I want to band items 2 through 4. So I'm trying to figure out which items are in the banding rectangle. Of course, any collapsed branches, the items inside those branches should be ignored. The tree above is a simple example, but I also need to be able to band items with different parents, etc. So anyways, my first idea was to create a rectangle for item2 and one for item4. Transform relative to the TreeView and do a hit-test on the rectangle. However, the hit-test returns: 1 4 3 2 The 4,3,2 is what I want obviously, but it included that darn 1 (the parent node). I understand that technically 2,3,4 are inside of 1, but the visual aspect of 1 is obviously not overlapping with 2,3,4. How can I only get 2,3,4? The issue is of course recursive, so if I have a tree: 1 -2 --3 ---a ---b --4 and band a -> b, I get 1, 2, 3, b, a...