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
425
Drag and Drop "Hit Zone"
posted

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!

 

 

  • 4475
    posted

    Hello,

    I have been looking into your question and in order to expand the needed field via DataTemplate you can set the TextBlock’s width, which will increase the space in which you can drop the target:

    <TextBlock Text="{Binding Data.Name}" Foreground="{Binding Data.FgColor}" Background="{Binding Data.BgColor}" Width=”500” >

    Where of course “500” is a hardcoded value, which you can set according to your needs.

    Please do not hesitate to contact us in case of future difficulties.

    Sincerely,
    Ekaterina
    Developer Support Engineer
    Infragistics Inc.
    www.infragistics.com/support