Unable to get status to chnage to DropComplete

6 posts, 0 answers
  1. Rod Yager
    Rod Yager avatar
    79 posts
    Member since:
    May 2010

    Posted 06 Jul 2011 Link to this post

    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
  2. Tsvyatko
    Admin
    Tsvyatko avatar
    833 posts

    Posted 08 Jul 2011 Link to this post

    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!

  3. UI for WPF is Visual Studio 2017 Ready
  4. Rod Yager
    Rod Yager avatar
    79 posts
    Member since:
    May 2010

    Posted 11 Jul 2011 Link to this post

    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.
  5. Rod Yager
    Rod Yager avatar
    79 posts
    Member since:
    May 2010

    Posted 11 Jul 2011 Link to this post

    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
  6. Rod Yager
    Rod Yager avatar
    79 posts
    Member since:
    May 2010

    Posted 11 Jul 2011 Link to this post

    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
  7. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 14 Jul 2011 Link to this post

    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!

Back to Top
UI for WPF is Visual Studio 2017 Ready