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

Cannot Drag from Windows Explorer into WPF RadTreeView

7 Answers 298 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Brent
Top achievements
Rank 2
Brent asked on 25 Jan 2016, 12:32 AM

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!

7 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 27 Jan 2016, 02:35 PM
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
0
Brent
Top achievements
Rank 2
answered on 27 Jan 2016, 03:47 PM

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!

0
Martin Ivanov
Telerik team
answered on 28 Jan 2016, 11:01 AM
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
0
Brent
Top achievements
Rank 2
answered on 28 Jan 2016, 04:06 PM

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!

0
Martin Ivanov
Telerik team
answered on 01 Feb 2016, 10:50 AM
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
0
Brent
Top achievements
Rank 2
answered on 08 Feb 2017, 05:41 PM

After a long while I have finally figured this one out so I thought I would post the solution in case anyone else experiences similiar issues. I was launching Visual Studio in "Administrator" mode.  since Windows Explorer launches by default in medium security by default and so visual studio would not allow dragging from a medium security to an elevated security mode.  See this posting for a full explanation.

 

http://stackoverflow.com/questions/15226600/visual-studio-does-not-let-me-drag-drop-items-into-it

 

0
Martin Ivanov
Telerik team
answered on 08 Feb 2017, 06:17 PM
Hello Brent,

That's great. Thank you for sharing your solution. I believe that it is going to be helpful for someone else too.

Regards,
Martin
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
DragAndDrop
Asked by
Brent
Top achievements
Rank 2
Answers by
Martin Ivanov
Telerik team
Brent
Top achievements
Rank 2
Share this question
or