This is a migrated thread and some comments may be shown as answers.

Drag & Drop Object From RadTreeview To Textbox

6 Answers 235 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Derick
Top achievements
Rank 1
Derick asked on 20 Mar 2011, 02:34 AM
This has probably been asked / answer previously - I couldn't find what I was looking for in my searches, though.

I've got a WPF RadTreeView set up, on WPF 4, with the last 2010 release of the Telerik WPF 4 controls. I've enabled drag & drop within my Treeview, and I am able to correctly drag the selected object (an "Equipment" class) within my treeview.

I've looked at the sample apps that show how to drag an item from a RadTreeview to a Textbox and set up everything correctly, according to the sample. Dragging a basic piece of text, like the example shows, works. However, dragging my Equipment class from the treeview to the Textbox (a standard WPF textbox) does not work. It constantly tells me that the drop is not allowed, even though I've implemented the DragQuery event and set e.QueryResults = true

any tips, tricks, or tutorials to help me get my situation working?

6 Answers, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 23 Mar 2011, 07:46 PM
Hello Derick,

I prepared a sample for you that is similar to the demo but the tree is now bound to a collection. Please examine it and let me know if it fits in your scenario.

Regards,
Petar Mladenov
the Telerik team
0
Derick
Top achievements
Rank 1
answered on 30 Mar 2011, 02:12 PM
Hi,

the sample mostly works - i am able to drag and drop items successfully now. However, when I drag a treeview item over the textbox, the tooltip on the drag cue shows me that i am not able to drop the item. it shows the red circle with a line through it. in spite of this, i am still able to do the drop.

is there a fix for this issue in a new release, possibly? I'm still working with the last 2010 release of the WPF controls.
0
Petar Mladenov
Telerik team
answered on 04 Apr 2011, 04:09 PM
Hello Derick,

This should be achieved with the RadDragAndDropmanager events dynamically. Could you please open a support ticket so that you can send us a runnable sample and we will investigate your scenario? If you can't, we can open a GeneralFeedBack support ticket so that you will be able to send projects.

Greetings,
Petar Mladenov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Erik
Top achievements
Rank 2
answered on 25 Jan 2012, 10:56 PM
<I got this working, so there's no need for follow up -- I just needed to follow the examples more closely.  :) >

I am trying to do exactly the same thing as described in this post an cannot even get the attached demo to work.  It runs, but the text box is not accepting the drop.

Here are a couple of notes:
  • The solution runs fine.
  • I am running the Q3 2011 WPF controls
  • I can drop into tree view just fine
  • The OnDropQuery and OnDropInfo events do not seem to be firing -- I put breakpoints on both functions and they never seem to get invoked.

Also, one other question that I'm trying to get worked out -- if I am dragging into a text box that contains some existing text, can I somehow drag the new content (also text) in the middle of the existing text? 
If not, cool, I'll just put it on the end and let the user move it from there.

0
Zoltan
Top achievements
Rank 1
answered on 12 Mar 2012, 04:46 PM
Hi,

I downloaded the attached example solution and the drag'n'drop doesn't seem to work for me. I'm using Telerik RadControls for WPF 2012 Q1.

Erik: how did you manage to get the demo working?

Thanks,
   Zoltan
0
Petar Mladenov
Telerik team
answered on 15 Mar 2012, 10:01 AM
Hello Zoltan,

 In 2011 , we introduced some changes in the RadDragAndDropManager. We also introduced a new DND Framework - the DragDropManager. I re-factored the mentioned project to use the new DNDManager and you can see it uploaded in this code library project.

Greetings,
Petar Mladenov
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
TreeView
Asked by
Derick
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Derick
Top achievements
Rank 1
Erik
Top achievements
Rank 2
Zoltan
Top achievements
Rank 1
Share this question
or