Remove Delete On Folders

2 posts, 0 answers
  1. Frank
    Frank avatar
    86 posts
    Member since:
    Mar 2012

    Posted 14 Apr 2014 Link to this post

    Is there a way to remove the ability to rename and delete of the folders?  I only want to give the users the ability to rename a delete files but the folders to be set and not allowed to modify.
  2. Vessy
    Admin
    Vessy avatar
    1380 posts

    Posted 17 Apr 2014 Link to this post

    Hi Frank,

    You can disable the delete/rename of folders by canceling the ClientDelete and ClientMove events in case the current item is a folder. For example, you can use a similar implementation:
    <telerik:RadFileExplorer runat="server" ID="RadFileExplorer1" OnClientDelete="OnClientDelete" OnClientMove="OnClientMove">
    </telerik:RadFileExplorer>
    <script>
        function OnClientDelete(explorer, args) {
            var isFolder = args.get_item().isDirectory();
            if (isFolder) {
                args.set_cancel(true);
                alert("You do not have permissions to delete folders.");
            }
        }
        function OnClientMove(oExplorer, args) {
            var isRename = args.get_newPath().search("/") < 0;
            var isFolder = args.get_item().isDirectory();
            if (isRename && isFolder) {
                args.set_cancel(true);
                alert("You do not have permissions to rename folders.");
            }
        }
    </script>

    More detailed information regarding the FileExplorer's Client-side events can be found here: Client-side events. I hope this information will be helpful for you.

    Regards,
    Vessy
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

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