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

Disable Drag-Drop not working

6 Answers 106 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 17 Mar 2014, 03:51 PM
I am using version 2013.3.1114.45.

I had this code to my Page_Load event:

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

But, I can still drag items in the client.  I added events to cancel the process, but I don't even want the animation to show.

6 Answers, 1 is accepted

Sort by
0
Peter
Top achievements
Rank 1
answered on 18 Mar 2014, 12:21 PM
Are we not allowed to edit posts any more?  

Sorry, that code was from the demo or another forum post, this is my code:

            rfeExplorer.TreeView.EnableDragAndDrop = False
            rfeExplorer.TreeView.EnableDragAndDropBetweenNodes = False
            rfeExplorer.Grid.ClientSettings.AllowRowsDragDrop = False
            rfeExplorer.Grid.ClientSettings.AllowDragToGroup = False
0
Vessy
Telerik team
answered on 18 Mar 2014, 03:36 PM
Hi Peter,

You can achieve the desired functionality on the client, by attaching a handler to the FileExplorer's nested Grid ClientDragStarted event and canceling it. This can be done in the FileExplplorer's ClientLoad event handler:
<telerik:RadFileExplorer runat="server" ID="rfeExplorer" Width="960px" Height="450px" EnableOpenFile="true" OnClientLoad="ClientLoad"
    DisplayUpFolderItem="false" EnableCreateNewFolder="false" TreePaneWidth="0" VisibleControls="ContextMenus,Grid,ListView,Toolbar"
    AllowPaging="true" PageSize="200">
    <Configuration ViewPaths="~/Images" UploadPaths="~/Images"
        DeletePaths="~/Images" EnableAsyncUpload="true"></Configuration>
</telerik:RadFileExplorer>
<script>
    function ClientLoad(explorer, args) {
        explorer.get_fileList().get_grid().add_rowDragStarted(RowDragStarted)
    }
    function RowDragStarted(grid, args) {
        args.set_cancel(true);
    }
</script>

I hope this helps.

Regards,
Vessy
Telerik
 

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

 
0
Peter
Top achievements
Rank 1
answered on 18 Mar 2014, 03:52 PM
Thanks, the grid is now blocked from dragging.  How do I get the listview to block the drag?

{Explorer}.ListView doesn't have any drag options or events.

0
Vessy
Telerik team
answered on 20 Mar 2014, 01:02 PM
Hi Peter,

The dragging of the ListView items can be done Server-side with the following configuration:
Protected Sub Page_Load(sender As Object, e As EventArgs)
    rfeExplorer.FileList.ListView.ClientSettings.AllowItemsDragDrop = False
End Sub


Kind regards,
Vessy
Telerik
 

Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

 
0
Peter
Top achievements
Rank 1
answered on 20 Mar 2014, 01:08 PM
That works, thanks...
0
Vessy
Telerik team
answered on 20 Mar 2014, 01:17 PM
Hi,

You are welcome, Peter. Do not hesitate to contact us in case we could be of any further assistance.

Kind regards,
Vessy
Telerik
 

Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

 
Tags
FileExplorer
Asked by
Peter
Top achievements
Rank 1
Answers by
Peter
Top achievements
Rank 1
Vessy
Telerik team
Share this question
or