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