DragDrop in WF 4.0 Designer

2 posts, 1 answers
  1. Greg
    Greg avatar
    3 posts
    Member since:
    Jul 2006

    Posted 20 Jan 2010 Link to this post

    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;  
  2. Answer
    Miroslav avatar
    922 posts

    Posted 25 Jan 2010 Link to this post

    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,
    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.
  3. DevCraft banner
Back to Top