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

Cancel Drap & Drop in RadFileExplorer

7 Answers 228 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
CSharp
Top achievements
Rank 1
CSharp asked on 31 Dec 2009, 08:44 AM
how can i Cancel Drap & Drop in RadFileExplorer?

7 Answers, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 31 Dec 2009, 08:58 AM
Hello CSharp,

In order to disable the drag&drop features of the file explorer controls you  need to set a couple of properties from your page code file (e.g. in the Page_Load() method):

RadFileExplorer1.TreeView.EnableDragAndDrop = false; 
RadFileExplorer1.Grid.ClientSettings.AllowRowsDragDrop = false; 

The first property disables drag&drop for the tree nodes, while the second disables dragging of the grid rows.


Best wishes,
Svetlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
CSharp
Top achievements
Rank 1
answered on 02 Jan 2010, 07:13 AM
i set this two properties, but still can drag 7 drop folders!!!!!!!!!!!!
0
Fiko
Telerik team
answered on 06 Jan 2010, 11:31 AM
Hi CSharp,

In your case you need to use client side approach in order to achieve the desired result. Could you please follow these steps and you will be able to cancel the OnClientMove event in RadFileExplorer:
  1. Attach a handler to RaFileExplorer's OnClientMove event
  2. Implement the handler as follows:

    function OnExplorerMoveHandler(oExplorer, args)
    {
        args.set_cancel(true);
    }

    This will cancel drag and drop in the Grid
  3. In order to cancel the draganddrop for the TreeView you need to attach a handler to the OnClientNodeEditing event of the TreeVIew:
    protected void Page_Load(object sender, EventArgs e)
    {
        RadFileExplorer1.TreeView.OnClientNodeEditing = "treeNodeEditing";
    }
  4. Implement the handler as follows:
    function treeNodeEditing(oTree, args)
    {
      args.set_cancel(true);
    }

I hope this helps.

Sincerely yours,
Fiko
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Fit2Page
Top achievements
Rank 2
Iron
Iron
Iron
answered on 10 Oct 2016, 01:34 PM

Hi Fiko,

 

It appears that this is not working (anymore)?

Are there new options to achieve this?

 

Marc

0
Vessy
Telerik team
answered on 12 Oct 2016, 02:44 PM
Hi Marc,

In order to disable fully the drag and drop functionality of FileExplorer by applying the following configurations to the control (note that they have to be set in the Page_PreRenderComplete event handler):
private void Page_PreRenderComplete(object sender, EventArgs e)
{
    RadFileExplorer1.TreeView.EnableDragAndDrop = false;
    RadFileExplorer1.Grid.ClientSettings.AllowRowsDragDrop = false;
    RadFileExplorer1.ListView.ClientSettings.AllowItemsDragDrop = false;
}


Regards,
Vessy
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
0
Fit2Page
Top achievements
Rank 2
Iron
Iron
Iron
answered on 13 Oct 2016, 07:14 AM
Thanks Vessy this works
0
Vessy
Telerik team
answered on 13 Oct 2016, 11:13 AM
Hi,

You are welcome, Marc. Let us know should any further question on this matter occurs.

Regards,
Vessy
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Fit2Page
Top achievements
Rank 2
Iron
Iron
Iron
commented on 26 Jul 2023, 09:11 AM

Hi Vessy,

 

I discover that the disabling of drag and drop is not working when ExplorerMode="Thumbnails" is set?

Can you please have a look at that?

 

Thanks, Marc

Rumen
Telerik team
commented on 27 Jul 2023, 11:13 AM

The following line

FileExplorer1.Grid.ClientSettings.AllowRowsDragDrop = false;

in the Page_PreRenderComplete event takes care of disabling the drag and drop of the Grid inside the Thumbnails ExplorerMode. You can check my test in the following video: https://youtu.be/vchzAjT2ZnI

Fit2Page
Top achievements
Rank 2
Iron
Iron
Iron
commented on 27 Jul 2023, 11:40 AM

Yes you are right but in GRID mode also the graphical interface (the optical drag) is not showing.

That is much more intiutive.

Hope I made myself clear...

 

Marc

Rumen
Telerik team
commented on 27 Jul 2023, 01:23 PM

Hi Marc,

I managed to disable the optical drag by modifying the ListView ItemTemplate and adding draggable="false" to the A tag:

 

        private void Page_PreRenderComplete(object sender, EventArgs e)
        {
            FileExplorer1.TreeView.EnableDragAndDrop = false;
            FileExplorer1.Grid.ClientSettings.AllowRowsDragDrop = false;
            FileExplorer1.ListView.ClientSettings.AllowItemsDragDrop = false;
            
            FileExplorer1.ListView.ClientSettings.DataBinding.ItemTemplate =
                @"<li class=""rfeThumbList rlvI"">
                    <a href=""javascript: void 0;"" draggable=""false"" class=""rfeLink rlvDrag#= isSelected ? ' rfeSelectedLink' : ''#"" data-index=""#= index #"" title=""#= Name #"">
                        <span class=""rfeFile#= Telerik.Web.UI.FileExplorerHelper.isWebImage(item.Extension) ? ' rfeImageFile' : '' #"">
                        # if(Telerik.Web.UI.FileExplorerHelper.isWebImage(item.Extension)) {#
                            <img src=""#= item.Url || Path #"" alt=""#= Name #"" width=""32"" height=""32"" />
                        # } else { #
                            <span class=""rfeFileIcon #= Telerik.Web.UI.FileExplorerHelper.getThumbnailCSSExtension(item) #""></span>
                        # } #
                        </span>
                        <span class=""rfeThumbTitle"">#= Name #</span>
                    </a>
                </li>";
        }

Fit2Page
Top achievements
Rank 2
Iron
Iron
Iron
commented on 31 Jul 2023, 10:49 AM

Yes! Very good Rumen.
Rumen
Telerik team
commented on 31 Jul 2023, 11:14 AM

Thank you, Marc!  I'm glad I could help you out!
Tags
FileExplorer
Asked by
CSharp
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
CSharp
Top achievements
Rank 1
Fiko
Telerik team
Fit2Page
Top achievements
Rank 2
Iron
Iron
Iron
Vessy
Telerik team
Share this question
or