Drag drop is driving me INSANE!

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Why is it that:
e.Data.GetDataPresent("WindowsForms10PersistentObject") returns true, and
e.Data.GetData("WindowsForms10PersistentObject") returns null?

Is it Friday yet?
 
The .Net Frameworks DataObject does not render all formats
that are available to an IDataObject implementation.

GetFormats tells you all of the formats that are available for a
particular IDataObject implementation.

GetDataPresent tells you that a particular format is available
to be rendered.

GetData get the data rendered in the format that you request.

If GetData returns null, then the DataObject can't render that format.
However, that format is available but the DataObject implementation can't
get it for you.

You can implement your own IDataObject and support the formats that
you need for your application.
 
Correction...I am sorry about that. You can create your
own implementation of IDropTarget which will allow you to
use an IDataObject instead of a .Net DataObject.

You will then be able to get the data rendered in the format
of your choice. If it is available!
 
Back
Top