drag and drop from listview to treeview

Posted by jmls on 18-Mar-2011 05:02

Trying to use the ultratreeview and ultralistview , and drag items from the listiew, dropping into the treeview.

Is this functionality is implemented as part of the controls ? I can't seem to be able to find the way out of the darkness that is UltraControls

Help!

All Replies

Posted by Admin on 18-Mar-2011 05:11

Drag & Drop is generally implemented for each Control.

Start in a MouseDown event handler and use the DoDragDrop method.

http://msdn.microsoft.com/en-us/library/system.windows.forms.control.dodragdrop.aspx

Make sure the receiving Control has the AllowDrop property set to true.

http://msdn.microsoft.com/en-us/library/system.windows.forms.control.allowdrop.aspx

I posted a D&D sample to the 10.2A beta forum, I can check later if it's still around.

Posted by jmls on 18-Mar-2011 15:28

right, getting there

I can drag from a MS listview to a Telerik treeview . WhooHoo !

now, I also need to drag nodes around within the treeview. However, the dragdrop event is getting fired for the drag (which is understandable) so I need to determine what was the source of the drag

The code I have in this event is

ListViewItem1 = CAST(e:Data:GetData (Progress.Util.TypeHelper:GetType("System.Windows.Forms.ListViewItem")),System.Windows.Forms.ListViewItem) .

is there any way of determining the type of the e:Data object ?

Posted by Admin on 18-Mar-2011 15:36

is there any way of determining the type of the e:Data object ?

For me it's always enough to rely on the fact, that it implementes IDataObject. So

e:GetDataPresent (Progress.Util.TypeHelper ("FullNameOf.ListViewItem"))

or

e:GetDataPresent (Progress.Util.TypeHelper ("FullNameOf.UltraTreeNode"))

get's me there. That method returns True of False.

This thread is closed