TreeView drag-n-drop between applications

  • Thread starter Thread starter Kevin Henkener
  • Start date Start date
K

Kevin Henkener

I would like to be able to drag-n-drop System.Windows.Forms.TreeNode
objects between two different applications (actually the same
application, just two instances of it) in C#. I've seen posts in
which people advise that this process is no different the
intra-application drag-n-drop process. I've had no luck with this
concept. In fact, when I drag a node from application A's TreeView to
application B's TreeView and call the GetData method on the Data
object from the DragEventArgs, the result is some kind of
System.Runtime.Remoting.Proxy.__TransparentProxy. There is no
TreeNode information available. I'm absolutely stumped at the moment
and would appreciate any help.

Thanks.
 
Kevin,

This is most likely because the TreeNode class is not marked as serializable
and is therefore marshalled between application domains by reference. I
would suggest creating a simple serializable type describing the data in the
node and use an instance of this type as the data object for the drag and
drop operation.
 
Back
Top