Drag and Drop utiliry

Answered
1
1

Hello,
I have developed an application that uploads pdf files to the server. each file is correlated with a particular row of a datagridview.
In datagridview a column shows, for each row, an icon if the row has an attached file.
It works perfectly (see attached image).

To upload the file using the upload component, you need to browse the PC folder to select the file to attach.

Wonder if it is possible to do this with the drag and drop functionality.

The idea is to drag the file from the PC window (eg Desktop or any folder), drag it to a datagridviewcell and get the event necessary to manage the upload code.

in other words like when I attach an image in this chat, by dragging and dropping on “choose file”.
I hope I have clearly explained my idea.
Thanks for any suggestions

Attachment
  • You must to post comments
Best Answer
0
0

Hi Angelo,

In addition to Luca’s answer, I’ve prepared a small sample project you can try using the DragDrop feature.

Please let me know if you have any questions or this isn’t clear!

Best regards,

Levie

  • You must to post comments
0
0

I have a similar question, I have a list view and I want to upload a file with the drag and drop, I have checked the Levi’s sample project but I still don’t know how to save the file, all I could do is get the file name(not the full path), and I wanted to convert the dragged file into a byte array, I hope it is possible to do so.

Thanks in advance!

  • You must to post comments
0
0

Thanks for the quick reply.
That’s exactly what I need.

Cheers

Angelo

  • You must to post comments
0
0

Wisej supports dropping files on any control. Don’t even need the Upload control. Just set AllowDrop=true and handle the drag drop events like in winforms. You can also check the file names or types being dragged. The information is limited by the browser.

https://stackoverflow.com/questions/68598/how-do-i-drag-and-drop-files-into-an-application

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.