How to drag and drop between two instances of the same application?

2 posts, 0 answers
  1. Martin
    Martin avatar
    17 posts
    Member since:
    May 2014

    Posted 04 Aug 2014 Link to this post

    My application contains a RadListbox and I'd like to drag and drop items in this RadListBox from one instance of my application to another instance. How can I accomplish this?

    It's similar to wanting the CustomDragVisualStyle_WPF example to support drag and drop between instances instead of just allowing drag and drop within one instance.

    I got it working with copy/paste buttons, but I also want to support drag and drop.
  2. Kalin
    Kalin avatar
    1284 posts

    Posted 07 Aug 2014 Link to this post

    Hi Martin,

    What I can suggest you would be to check the following article which explains how to achieve the desired:

    You will need to add the [Serializable] attribute to your custom object and using the DragDropManager in the DragInitialize method to create new Serializable DataObject as shown below:

    private void OnDragInitialize(object sender, DragInitializeEventArgs e)
        e.AllowedEffects = DragDropEffects.All;
        e.Data = new DataObject(DataFormats.Serializable, new Customer { FullName = "Customer" });
        e.Handled = true;

    Afterwards on Drop in the second instance of the Application you can get the object the following way:

    private void OnDrop(object sender, Telerik.Windows.DragDrop.DragEventArgs e)
        var data = (e.Data as DataObject).GetData(DataFormats.Serializable) as Customer;

    Hope this will help you to achieve the required.

    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
Back to Top