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

DragDrop in WF 4.0 Designer

1 Answer 59 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Greg
Top achievements
Rank 2
Greg asked on 20 Jan 2010, 08:39 PM
Hi there,

I am busy evaluating Telerik's WPF controls and came to a bit of a road bump I hope you can help.
I am trying to Drag and Drop from a ListBox (this will eventually be a RadPanelBar) to a re-hosted Workflow 4.0 Designer (It's a WPF control as well). 

I have got this working with the normal WPF drag and drop implementation for example.
Type type = ((AvailableActivity)(((ListBox)sender).SelectedItem)).Type; 
DataObject data = new DataObject(DragDropHelper.WorkflowItemTypeNameFormat, type.AssemblyQualifiedName); 
DragDrop.DoDragDrop(this.box1, data, DragDropEffects.Move); 

The WF Designer then queries the DataObject when its being dragged over and handles it from there.

My question is, is there anyway to provide the DataObject to the WF Designer as it expects it using the Telerik Drag and Drop? I have followed your drag and drop tutorials and got it working between list boxes, from RadPanelBar to ListBox etc. This is what I currently have.

private void OnDragQuery(object sender, DragDropQueryEventArgs e) 
if (e.Options.Status == DragStatus.DragQuery) 
AvailableActivity activity = ((AvailableActivity)((System.Windows.Controls.ListBox)(e.Options.Source)).SelectedItems[0]); // get the activity from the list 
                    
DataObject data = new DataObject(DragDropHelper.WorkflowItemTypeNameFormat, activity.Type.AssemblyQualifiedName); 
                    
e.Options.DragCue = activity.Type.AssemblyQualifiedName;  
e.Options.ArrowCue = RadDragAndDropManager.GenerateArrowCue();  
e.Options.Payload = activity.Type.AssemblyQualifiedName;    
e.QueryResult = true
e.Handled = true;  
 
Thanks
Greg

1 Answer, 1 is accepted

Sort by
0
Accepted
Miroslav
Telerik team
answered on 25 Jan 2010, 03:10 PM
Hello Greg,

The Telerik DragDrop is not based on the WPF built-in DragDrop and it does not use the same events. If the WF designer is listening for them then I am afraid I cannot suggest how the two DragDrops can be integrated.

To be honest I have not tried to integrate DragDrop and the WorkFlow designer. If dropping is achieved with custom code, then I may be able to convert it for you so that it uses the TelerikDragDrop.

I  am not sure how the designer works and you may achieve better integration with the built-in DragDrop.

Please also note that the Telerik DragDrop works only for object within the same Window, i.e. it does not work for drag-drops across applications or windows.

All the best,
Miroslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
DragAndDrop
Asked by
Greg
Top achievements
Rank 2
Answers by
Miroslav
Telerik team
Share this question
or