I would like my users to be able to renamed or delete files, but not folders. I found the post asking how to prevent subfolders from being created, but delete and renaming seem to be different animals.
2 Answers, 1 is accepted
0
Accepted
Ivan Danchev
Telerik team
answered on 27 Jan 2021, 04:59 PM
Hello,
You can achieve that with conditional logic in the FileManager's "Execute" event handler:
1. Attach an "Execute" event handler. 2. In the handler check the name of the command and whether the selected item is a folder. If the conditions are fulfilled, prevent the event:
functiononExecute(e) {
if (e.command == "DeleteCommand" || e.command == "RenameCommand") {
if (e.sender.getSelected()[0].isDirectory) {
e.preventDefault();
}
}
}
Regards,
Ivan Danchev
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/.