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

Drag and Drop from RadTreeView to WorkflowDesigner

2 Answers 165 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 17 Nov 2011, 01:09 AM
Hi,

I have a WPF application in which I rehost the .Net 4.0 Workflow designer alongside a RadTreeView. Items on the RadTreeView are dragged onto the designer and, when dropped, morph into self configuring workflow activities based on the context from which they were dragged.

I am using Telerik's DragDropManager and the AddDragEnterHandler and AddDragOverHandler methods to add handlers to the Workflow Designer View and that is working perfectly. However...

I need to control the drag cue over the designer and that is proving to be more problematic.

I first tried the following:
RadDragAndDropManager.AddDragQueryHandler(this.Designer.View, this.Designer_DragQueryHandler);

However the Designer_DragQueryHandler delegate would never fire.

So I thought it must be that the designer is handling that event before my delegate can be executed, so I tried the following:
this.Designer.View.AddHandler(RadDragAndDropManager.DragQueryEvent, new EventHandler<DragDropQueryEventArgs>(this.Designer_DragQueryHandler), true);

This did not work either.

I am at a dead end on this now and would greatly appreciate any direction on how I might achieve this.

Thanks in advance
Chris

2 Answers, 1 is accepted

Sort by
0
Accepted
Tsvyatko
Telerik team
answered on 18 Nov 2011, 10:21 AM
Hello Chris,

 Since Workflow designer is the drag destination you might consider using DropQuery event instead.

If this does not help in your case you can persist the dragcue when drag started either in custom field or complex payload (dataobject) that keeps information about dragged data as well as DragVisual. 

Let us know if this helps in your case.

All the best,
Tsvyatko
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Chris
Top achievements
Rank 1
answered on 22 Nov 2011, 02:10 AM
Hi Tsvyatko

Thank you for the response. I had tried DropQuery and DragQuery without any success.

I ended up using your suggestion of the complex DataObject and that has worked great.

Cheers
Chris
Tags
DragAndDrop
Asked by
Chris
Top achievements
Rank 1
Answers by
Tsvyatko
Telerik team
Chris
Top achievements
Rank 1
Share this question
or