We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Drag & Drop of own TreeNodes

Thread ID:




8104 Oct 21,2003 08:18 AM UTC WinForms 0
Tags: FAQ
Diana Krapf
Asked On October 21, 2003 08:18 AM UTC

I use an tree view with different types of tree nodes. My own TreeNodes are derived from TreeNode and some of the derived classes implement an Interface IMyInterface. In the tree view class I have different event handler for drag and drop. I want to check if the dragged node implements IMyInterface and than do something with the data. How can I do this with DragEventArgs e e.Data.GetDataPresent(...)/e.Data.GetData(...). Is it possible to use e.Data.GetData(...) with the interface? I cant' find it. My workaround is to create a new DataObject in ItemDrag and to use it with DoDragDrop: DataObject data = new DataObject("System.Object",e.Item); DoDragDrop(data, DragDropEffects.Link); and then to get an object like this: Object o = e.Data.GetData(typeof(Object)); if (o is IMyInterface) doSomething(); Is there another way to implement this? Thanks in advance. Diana Please send your response via email to Diana.Krapf@gmx.de as well.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon