Hello,
I am using XamDataTree. Evertything works now as expected except this problem :
When I drag a node over another node, I absolutely need to be at the exact position where there is the text of the node even if the height of the node is bigger. It is very hard for the user to always leave the mouse cursor exactly over the text and most of the time, he leaves the cursor just a few pixels higher or lower than the text. I see that the hit zone works fine with the current over node where the mouse is. The node has a colored background that appears as soon as the cursor is in the bound of the node size, however, the line has a colored background only when the cursor is exactly over the text.
I am using a custom NodeLayout :
with the ItemTemplate as follow :
<ig:NodeLayout.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Data.Name}" Foreground="{Binding Data.FgColor}" Background="{Binding Data.BgColor}">
</TextBlock>
</DataTemplate>
</ig:NodeLayout.ItemTemplate>
I've tried to use stackpanel, label, rectangle, force height, etc.. nothing works for drag at the moment.
Thank you!
I am just checking if my last reply was helpful for you.
If you require any further assistance please do not hesitate to ask.
Sincerely,
Ekaterina
Developer Support Engineer
Infragistics
www.infragistics.com/support
Hello InfragisticsMaster,
I have been looking into your issue and I have modified my project, but I did not manage to reproduce the described behavior. My tree now has one root node which contains of some single nodes and couple of sibling nodes. I am attaching my sample in order for you take a look at it.
I will be looking forward to receive some feedback from you.
Infragistics, Inc.
Hello infragisticsMaster,
I am currently investigating you new requirements and I will need some more time. I will follow up with you shortly.
Thank you for your patience.
In your source code, the problem is in XamDataTreeNodeControl.cs :
Three time in the file, you are verifying the position of the cursor inside the node height. The percentage is the first 1/3 and the last 1/3.
example:
if (pt.Y <= height * 0.33333 || pt.Y >= height * 0.66666)
This test can only be performed if the node accepts sibiling node, otherwise the default operation "drag-into" should be applied regardless of the position of the cursor.
Thank you.
I've found the bug. It not related to the size of the node.
The problem is because I am dragging the "child" node into a "parent" node. The parent node does NOT accept having a sibling "child" node. So when the child node is in the first 1/4 of the height of the parent node, the sibling line is not shown because it's not permitted. When the cursor is in the middle of the node, the node will drag, and when the node is in the last 1/4 of the height of the parent node, the sibiling line is not shown because it's not permitted.
When it's not permitted, the tree should take the whole zone of the parent node to drag. Otherwise, the user has a lot of problem dragging node since the upper and lower zone won't drag it.
I tried to find out a way to avoid this behavior and I found nothing.
Can you give me information on how to fix this problem or a new build with this problem fixed?