Cannot Drag from Windows Explorer into WPF RadTreeView

6 posts, 0 answers
  1. Brent
    Brent avatar
    33 posts
    Member since:
    Jun 2010

    Posted 24 Jan Link to this post

    Hello Guys,

      I am having issues to do this. I have setup the following RadTreeView control:

     

    <telerik:RadTreeView   AllowDrop="True"  
                                       telerik:AnimationManager.IsAnimationEnabled="False"
                                       Name="trvModule" ItemsIndent="15"
                                       IsLineEnabled="True"
                                       IsRootLinesEnabled="False" FontSize="11" 
                                       IsDropPreviewLineEnabled="True"
                                       IsDragDropEnabled="True" 
                                       IsLoadOnDemandEnabled="False" 
                                       DropExpandDelay="00:00:00" 
                                       BringIntoViewMode="HeaderAndItems"
                                       />

     

    In the Code Behind I have the following:

     

            DragDropManager.AddDragInitializeHandler(trvModule, New DragInitializeEventHandler(AddressOf OnDragInitialize), True)
            DragDropManager.AddDragOverHandler(trvModule, AddressOf OnDragOver, True)
            DragDropManager.AddDragDropCompletedHandler(trvModule, New DragDropCompletedEventHandler(AddressOf OnDragDropCompleted), True)
            DragDropManager.AddDropHandler(trvModule, New DragEventHandler(AddressOf OnDropElement), True)

     

     I have seen this working in Windows Apps, but I am not being able to make it work in my WPF application.

    I saw this might be to a security problem? 

    Can you please provide any help to solve the problem? 

    I cannot attach the project for security restrictions, but I can paste any piece of code you need.

     

     Any help will be much appreciated.

    Thanks!

  2. Martin
    Admin
    Martin avatar
    1099 posts

    Posted 27 Jan Link to this post

    Hi Brent,

    I am afraid that without your implementation and environment I cannot tell why the drag operation doesn't work. However, I prepared a small example demonstrating drag/drop between files in the Windows Explorer and a WPF RadTreeView. Please give it a try and let me know if I am missing something. 

    Keep in mind that while you are dragging from an external application the default drag/drop behavior of RadTreeView and its visual appearance won't work. Also, the DragInitialize handler won't be fired since the drag starts in the external source.

    Regards,
    Martin
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
  4. Brent
    Brent avatar
    33 posts
    Member since:
    Jun 2010

    Posted 27 Jan in reply to Martin Link to this post

    Thanks Martin.
     Even though your solution works, the application type is a "Windows Application". I am not having problems with that.
       I am having problems with WPF Application types.

     

    I cannot attach the solution here for some reason, so please take a look at the screenshots.

    Thanks!

  5. Martin
    Admin
    Martin avatar
    1099 posts

    Posted 28 Jan Link to this post

    Hi Brent,

    I sent you a C# project so please excuse me for that. I create a new one on VB.NET with its application type set to WPF application and everything works as expected. Can you please check it out and let me know if it works on your side?

    As a side note, you cannot attach the solution because the forum allows adding only image files. If you want to send us a .zip file with the project that demonstrates the issue you can open a new support ticket from your telerik.com account.

    Regards,
    Martin
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  6. Brent
    Brent avatar
    33 posts
    Member since:
    Jun 2010

    Posted 28 Jan Link to this post

    Hello Martin, I think I see the problem, but I am not sure what the root cause is.

    Basically, I run your app and I was able to drag and drop fine. But when I run my app (which is MOSTLY the same), it won't work.

    Looking for differences, I found that you have in the Debug folder a Manifest file setting some security permissions. After digging into that, I found that I am able to run the app and drag and drop files if I run the app from outside visual studio, but not from within.

     

    So question is:

    What security configuration is required in the proyect for drag and drop to work within visual studio? 

    Is this related to the manifest file as mentioned?

     

    Thanks!

  7. Martin
    Admin
    Martin avatar
    1099 posts

    Posted 01 Feb Link to this post

    Hello Brent,

    I haven't made any changes in the project's configuration. I just created a new VB.NET WPF Application from the "Add New Project" dialog. It seems that Vistual Studio is adding the .manifest file by default.

    You can check if the drag operation works in a new VB.NET project. And, if you have any specific configuration on your project or Visual Studio itself. Also, you can try your project on a different machine.

    Regards,
    Martin
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for WPF is Visual Studio 2017 Ready