This is not a complete answer to your question but it might give you a starting point and something to work on while you are waiting for someone to give a complete answer.
Make sure to set the
AllowDrop
property of your dgv to
true
.
Then paste in the code from the example on
this page[
^]
In the Events tab of the Properties Window double click on the
DragDrop
event to get an empty event handler and call
GetAllFormats()
from this event handler.
You might want to change the
TextBox
in the example to a
ListBox
and add each format to that.
Then try dropping some data from Excel onto your dgv.
I believe that when you copy data from Excel to the Clipboard it copies it as HTML and as a String (or at least it used to), it may also use some other formats as well and I assume that it does the same sort of thing for Drag-Drop. Once you know the DataFormats available to you, you can experiment with them in turn to decide how to handle each and discover how the data is organized. For example for the
String
DataFormat you could load the data into a TextBox to examine it.
In case you aren't familiar with the process
this[
^] page has an example of handling dropped data (it's for a ListBox but the principle is the same). Look at the
ListDragTarget_DragDrop
method and modify it to display the data in an appropriate control.
Hope this helps and that you get a more complete answer. :)