We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

WPF TreeViewAdv: How to disable drop for specific TreeViewItemAdv

Please note - this question pertains to the WPF Tools TreeViewAdv control. The submission form for the forum doesn't work when trying to create a question with WPF as the platform!

I have a tree view control that allows dragging items for copies and moves within the same tree. Certain types of nodes within this tree cannot be drop targets for certain other types of nodes, so I would like to disallow drops during a drag. Typically, setting the Effects property to None in the DragEnter or DragOver event handler should provide the needed mouse cursor feedback indicating that the operation isn't allowed. However, nothing I've been able to do stops the tree view from completing the drag/drop. It always moves or copies the nodes even when I set the Effect to None.

I've set event handlers at both the TreeViewAdv control level and at the TreeItemAdv control level (through a style) but I can't seem to get the behavior I want.

How can I take deeper control of this capability? None of the samples provided do anything like this.

Can you provide some guidance on this please?

Thanks,

Kevin


3 Replies

MA Muthukumar A Syncfusion Team May 10, 2014 07:32 AM UTC

Hi Kevin Walsh,

We have created a sample which meets your requirement.Please find it from following location.
In this sample, we have cancelled the drop based on the Dragging item on DragEnter with appropriate DragDropEffects set.
Please let us know if you need further assistance.

Regards,
Muhukumar A

Attachment: TreeviewItem_116232_5b686cdd.zip


KW Kevin Walsh May 16, 2014 05:14 PM UTC

Thank you, Muhukumar, I will examine the sample and let you know. I appreciate your help.


MA Muthukumar A Syncfusion Team May 21, 2014 08:27 AM UTC

Hi Kevin Walsh,

Thank you for your update
We will wait until we get further information from you.

Regards,
Muthukumar A

Loader.
Up arrow icon