Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
185
WinTree DrawFilter DropLinePosition not set for non-standard ViewStyle
posted

Hi,

 

I have  a problem that looks like an issue with drag and drop in WinTree. I followed the Navigation -> WinTree -> Drag and Drop sample from Netadvantage 2010 Volume 2 exactly with the only difference that I have set ViewStyle to FreeForm and added some columns (The OutlookExpress style is behaving the same so I guessed that all non-Standard styles do this).

The DropLinePosition  in the DrawFilter seems to not be updated at all and the node is always dropped below.

I tested that the DropLinePosition is updated in the sample and it is also updated in my application if I change the ViewStyle to Standard.

Later edit: I tried it the other way around and changed the sample to ViewStyle FreeForm and added to columns (and values for the corresponding cells in the nodes) and the DropLinePosition doesn't get set anymore.

Even later edit: I was mistaken about the source of the problem so I updated the text.

 

Thanks,

Vlad

Parents
No Data
Reply
  • 185
    posted

    Never mind, I found the issue. It's an error in the Drag and Drop sample code. Well, not a fatal error, but an imprecise computation lets say.

    The way coordinates in the tree are computed is using the Node.Bounds property which does not reflect the UI client coordinates and sizes. I changed this to Node.UIElement.Rect and everything works ok. In my case the major error was introduced by the existence of column headers in FreeForm which are not reflected in the Node.Bounds property.

Children
No Data