I have used the example to drag windows explorer files by enabling the EnableNativeDrag option. I added my DropQuery and DropInfo handlers and they seem to be firing fine but the status is always DragPossible. I am dragging a file from my desktop to a ListView with a GridView, GridViewColumns and CellTemplates defined. I have allowed drop on both the ListView and ListViewItems and nothing seems to allow the status to change to DropComplete. Help!
Rod Yager
RadDragAndDropManager.SetAllowDrop(theListView,
true
);
RadDragAndDropManager.AddDropQueryHandler(theListView, OnAttachmentsDropQuery);
RadDragAndDropManager.AddDropInfoHandler(theListView, OnAttachmentsDropInfo);
protected
virtual
void
OnAttachmentsDropInfo(
object
sender, DragDropEventArgs e)
{
if
(e.Options.Status == DragStatus.DropComplete)
{
StringCollection fileList = e.Options.DropDataObject.GetFileDropList();
foreach
(
string
file
in
fileList)
{
//Take only the file name.
string
fileName = file.Substring(file.LastIndexOf(System.IO.Path.DirectorySeparatorChar) + 1, file.Length - file.LastIndexOf(System.IO.Path.DirectorySeparatorChar) - 1); }
}
}
private
void
OnAttachmentsDropQuery(
object
sender, DragDropQueryEventArgs e)
{
e.QueryResult = e.Options.DropDataObject !=
null
&& e.Options.DropDataObject.ContainsFileDropList();
}
Rod Yager