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.
Unfortunately, activation email could not send to your email. Please try again.

Drag and Drop a TreeViewItemAdv from a treeview onto a textbox

Thread ID:

Created:

Updated:

Platform:

Replies:

95049 Jun 17,2010 09:52 AM Jun 23,2010 02:29 PM WPF 4
loading
Tags: Tools
Administrator [Syncfusion]
Asked On June 17, 2010 09:52 AM

Hello,

I am trying to allow users to drop a tree node onto/into a TextBox. However, when I drag the node over the TextBox, the drop indicator changes into "can't be dropped" image and the DragEnter and DragOver events of the TextBox are not firing.

Is there anyway to allow tree nodes to have a drop target that is a TextBox?

Chad

David C [Syncfusion]
Replied On June 18, 2010 08:54 AM

Hi Chad,

Thanks for your interest in syncfusion products.

We can Drag the TreeViewItemAdv into TextBox."PreviewDragEnter" event of the TextBox is the best choice for that. Here we have attached the small workaround sample which illustrates this scenario. We hope it will satisfy your needs.

Please let us know if you have any queries.

Regards,
David C



TreeViewDragSample_e73041a0.zip

Administrator [Syncfusion]
Replied On June 18, 2010 01:26 PM

Thanks David,

This is very close to what I am looking for. There are two things:

1) From a visual perspective, when I drag the tree node onto the text box, the drap indicator changes to the "cannot drop" circle with a line through it. I tried setting the dragged node's AllowDrop to true in the text box's PreviewDragEnter, but the indicator remained "cannot drop".

2) Neither the PreviewDrop or the Drop event are firing for the text box.

Are there any workarounds to these two issues?

Chad

David C [Syncfusion]
Replied On June 21, 2010 09:59 AM

Hi Chad,

Thanks for your update.

1. Change the "cannot drop indicator".
You can change the appearance of the Mouse cursor by using the DragDropEffects enum. The attached sample which illustrates in detail.
2. Neither the PreviewDrop or the Drop event are firing for the text box.
TexBox will fire the Drop event only when e.Handled is equal to true on DragOver. The sample attachment explains that clearly.

Regards,
David C



TreeViewSample_81c1eb3f.zip

Administrator [Syncfusion]
Replied On June 23, 2010 02:29 PM

Perfect!

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;