Click here to Skip to main content
15,893,644 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi i need help on drag drop.
My scenario is i have listview with different type of files like TXT, doc, img etc.
I need to implement drag and drop functionality on my listview. Like user can drag item from listview and he can drop it either in windows explorer or treeview control on the application.
When the item is dropped to windows explorer then that file should be downloaded. If user drop that file to treeview then that file is moved to the selected node of the treeview.
My problem is, in item drag event when the user tries to drop the file on treeview then data should se sent as listview item in DoDragDrop method, and when user drops to the explorer then i am creating file in temp folder and then sending the path to DoDragDrop Method.
So how can i do this task alternatively.
Posted
Updated 6-Mar-14 0:39am
v2
Comments
BillWoodruff 6-Mar-14 7:56am    
Is this ASP.NET ? Windows Forms ?

I suggest you show your code for the various Drag/Drop Events.

Why your are creating temporary files for this simple task instead of this you can try file copying method as follows.

C#
System.IO.File.Copy("SourcePath","DestinationPath");


Thanks & Regards
Anand. G
 
Share this answer
 
Comments
sagar_253 14-Mar-14 2:50am    
Thanks for the reply, but that is not my problem,
Issue is sending different data object to DoDragMethod at runtime.
So is there any alternative for doing drag and drop.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900