Hide/disable Delete/rename in File Manager

Is there an easy way of disabling/hiding the (delete/create new folder/rename) from the context menu and menu bar of the file manager?


1 Reply 1 reply marked as answer

SP Sowmiya Padmanaban Syncfusion Team September 17, 2020 01:18 PM UTC

Hi Gudmundur Gislason,  
 
Greetings from Syncfusion support. 
 
We have checked your requirement with FileManager component (Hide the particular item in context menu/menu bar). By using ContextMenuSettings and ToolbarSettings , we can display the particular items based on your requirement. So, there is no need to hide the items. 
 
Please refer to the below code snippet. 
 
@using Syncfusion.Blazor.FileManager 
 
<SfFileManager ID="filemanager" @ref="file" > 
                             UploadUrl="https://ej2-aspcore-service.azurewebsites.net/api/FileManager/Upload" 
                             DownloadUrl="https://ej2-aspcore-service.azurewebsites.net/api/FileManager/Download" 
                             GetImageUrl="https://ej2-aspcore-service.azurewebsites.net/api/FileManager/GetImage"> 
    </FileManagerAjaxSettings> 
    <FileManagerContextMenuSettings File="@Items" Folder="@Items"></FileManagerContextMenuSettings> 
    <FileManagerToolbarSettings Items="@Items" ></FileManagerToolbarSettings>> 
</SfFileManager> 
@code{ 
    SfFileManager file; 
    public string[] Items = new string[] { "Open", "|", "Upload", "Refresh", "Download"}; 
    public string[] Toolbar_Items = new string[] { "Open", "|", "Upload", "Refresh", "Download" }; 
} 
 
 
Please, refer to the below link to know more about context menu settings. 
 
 
Please, download the sample from the following link. 
 
 
Refer to the below links to know more about the FileManager component. 
 
 
 
 
Please let us know, if you need any further assistance. 
 
Regards,  
Sowmiya.P 


Marked as answer
Loader.
Up arrow icon