Disable Drag-Drop not working

7 posts, 0 answers
  1. Peter
    Peter avatar
    71 posts
    Member since:
    Mar 2012

    Posted 17 Mar 2014 Link to this post

    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.
  2. Peter
    Peter avatar
    71 posts
    Member since:
    Mar 2012

    Posted 18 Mar 2014 in reply to Peter Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Vessy
    Admin
    Vessy avatar
    1380 posts

    Posted 18 Mar 2014 Link to this post

    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.

     
  5. Peter
    Peter avatar
    71 posts
    Member since:
    Mar 2012

    Posted 18 Mar 2014 in reply to Vessy Link to this post

    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.

  6. Vessy
    Admin
    Vessy avatar
    1380 posts

    Posted 20 Mar 2014 Link to this post

    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.

     
  7. Peter
    Peter avatar
    71 posts
    Member since:
    Mar 2012

    Posted 20 Mar 2014 in reply to Vessy Link to this post

    That works, thanks...
  8. Vessy
    Admin
    Vessy avatar
    1380 posts

    Posted 20 Mar 2014 Link to this post

    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.

     
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017