This is a migrated thread and some comments may be shown as answers.

Unable to get status to chnage to DropComplete

5 Answers 101 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Rod Yager
Top achievements
Rank 1
Rod Yager asked on 06 Jul 2011, 07:26 PM
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!

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

5 Answers, 1 is accepted

Sort by
0
Tsvyatko
Telerik team
answered on 08 Jul 2011, 03:09 PM
Hello Rod Yager,

 I have build simple application based on the code posted that illustrates the desired functionality. Would it be possible to check it as let us know if it helps resolving your issue. If not, would it be possible to share some additional information about the XAML and any other drag/drop handlers involved.

Greetings,
Tsvyatko
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Rod Yager
Top achievements
Rank 1
answered on 11 Jul 2011, 03:06 PM
Not sure if it matters, but I am using the standard .net listview with a gridview specified. The listview already has listviewitems and I am trying to drag onto the a listviewitem to add a new object dragged from windows explorer. I see the drag indicator and the OnAttachmentsDropInfo fires just fine but the status is never DropComplete when I drop the object.
0
Rod Yager
Top achievements
Rank 1
answered on 11 Jul 2011, 03:45 PM
I think I found the problem. My listview resides in a RadTabControl/RadTabItem. If I switch this to use a .net TabControl/TabItem, the DropComplete happens. Somehow the Telerik TabControl/TabItem is stealing the Drop functionality. I tried setting both the RadTabControl and RadTabItem AllowDrop to false and still didn't work. Any ideas?
Thanks,
Rod
0
Rod Yager
Top achievements
Rank 1
answered on 11 Jul 2011, 08:22 PM
Also, if you could tell me how it would be possible to drag and drop an outlook email that would be helpful too. I found examples but most of the examples I can't seem to get working against the Telerik event args.

DragDropEventArgs


http://www.codeproject.com/KB/office/outlook_drag_drop_in_cs.aspx
0
Tina Stancheva
Telerik team
answered on 14 Jul 2011, 09:53 AM
Hi Rod Yager,

 Using data objects with RadDragAndDropManager is similar to the one in the build-in drag drop. What needs to be handled in the sample from codeproject are the difference between Winforms and WPF dataObject implementation. I have updated and reattached the sample project.

Also, can you please test your application using the Q2 2011 official release. The drag/drop scenario you described with the RadTabControl should work with that release.

Best wishes,
Tina Stancheva
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
DragAndDrop
Asked by
Rod Yager
Top achievements
Rank 1
Answers by
Tsvyatko
Telerik team
Rod Yager
Top achievements
Rank 1
Tina Stancheva
Telerik team
Share this question
or