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

Preventing DragDrop

2 Answers 21 Views
FileDialogs
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 23 Apr 2021, 10:37 AM

Hi,

How can I prevent the DragDrop operation in the File Open and File Save dialogs?

Thanks

Steve

2 Answers, 1 is accepted

Sort by
0
Steve
Top achievements
Rank 1
answered on 23 Apr 2021, 11:16 AM

I think I've found it

                ...SaveFileDialogForm.ExplorerControl.FileBrowserListView.AllowDrop = False
                ...SaveFileDialogForm.ExplorerControl.MainNavigationTreeView.AllowDrop = False

Steve

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 23 Apr 2021, 12:55 PM

Hello, Steve,

The ExplorerControl used in the file dialogs internally uses a RadListView which handles the whole drag and drop operation by its ListViewDragDropService. By using the ExplorerControl.FileBrowserListView property you can access this list view. 

As you have already found out setting the ExplorerControl.FileBrowserListView.AllowDrop property to false will disable the whole drop operation to this control.

If you need to control the drop behavior and allow it in certain cases, the PreviewDragOver event of the service allows you to control on what targets the file(s) being dragged can be dropped on.

The whole API of the service is explained here: https://docs.telerik.com/devtools/winforms/telerik-presentation-framework/raddragdropservice 

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
FileDialogs
Asked by
Steve
Top achievements
Rank 1
Answers by
Steve
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or