Drag and Drop from RadTreeView to WorkflowDesigner

3 posts, 1 answers
  1. Chris
    Chris avatar
    18 posts
    Member since:
    Nov 2009

    Posted 16 Nov 2011 Link to this post


    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
  2. Answer
    Tsvyatko avatar
    863 posts

    Posted 18 Nov 2011 Link to this post

    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,
    the Telerik team

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

  3. Chris
    Chris avatar
    18 posts
    Member since:
    Nov 2009

    Posted 21 Nov 2011 Link to this post

    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.

Back to Top