How to change Text of Layout, File and Folder menu items

Hi

I'd like to set the Text field of the context menu items in the MenuOpened event.
It does not work for standard items (e.g. newfolder)  as well as for custom items (e.g. changepermission)
 Please see my code below:

 // menu items
 public string[] LayoutItems = ["sortby", "View", "Refresh", "|", "Paste", "|", "New Folder", "New Model", "New Block Folder", "|", "Details", "|", "SelectAll"];
 public string[] FileItems = ["FileItems", "Cut", "Copy", "Download", "|", "Delete", "Rename", "|", "Details"];
 public string[] FolderItems = ["Open", "|", "Cut", "Copy", "Paste", "|", "Delete", "Rename", "newfolder",
"New Model", "New Block Folder", "|", "Share", "Unshare", "changepermission" , "|", "Details"]; // The file item id is: <FileManager.Id>_cm_<lowercase item name without spaces> // E.g: Filemanager-4b57b371-758f-4474-998a-d544bd62ab09_cm_changepermission private static readonly Dictionary<string, string> _menuItemTexts = new() { ["cm_sortby"] = "Sort by", ["cm_newfolder"] = "New Folder", ["cm_changepermission"] = "Change Permission", }; private static readonly Dictionary<string, string> _menuItemIcons = new() { ["cm_newmodel"] = "so-menu-icon-model", ["cm_newblockfolder"] = "so-menu-icon-blockfolder", ["cm_newfolder"] = "so-menu-icon-folder", }; private async Task MenuOpened(MenuOpenEventArgs<SoFileManagerDirectoryContent> args) { var fileOrFolder = args.FileDetails?.FirstOrDefault(); if (fileOrFolder == null) return; // Set text of all menu items and icon css class foreach (var menuItem in args.Items) { var textMatch = _menuItemTexts.FirstOrDefault(kv => menuItem.Id.EndsWith(kv.Key)); if (textMatch.Key != null) menuItem.Text = textMatch.Value; // >>>>> does not work !!!!!!!!!! var iconMatch = _menuItemIcons.FirstOrDefault(kv => menuItem.Id.EndsWith(kv.Key)); if (iconMatch.Key != null) menuItem.IconCss = iconMatch.Value; }

(...)

Regards, Bruno


2 Replies

PS Praveen Sellappan Syncfusion Team June 19, 2026 02:19 PM UTC

Hi Bruno,

 

Based on the information provided, we have validated and classified the reported scenarios regarding the “File Manager Context Menu Fails to Update Item Properties Dynamically in the MenuOpened Event" as a bug on our end. The fix for this issue will be included in the upcoming weekly release scheduled for July 7,2026.

 

You can track the status of the fix through the following feedback link.

 

File Manager Context Menu Fails to Update Item Properties Dynamically in the MenuOpened Event in Blazor | Feedback Portal

Disclaimer: The provided tentative release timeline is subject to change in the future based on development priorities and testing outcomes.

 

Regards,

Praveen Sellappan



PS Praveen Sellappan Syncfusion Team July 10, 2026 02:49 PM UTC

Hi Bruno,

 

Thanks for your patience.

  

We are pleased to inform you that our weekly patch release has been successfully rolled out, and the issue "File Manager Context Menu Fails to Update Item Properties Dynamically in the MenuOpened Event" has been resolved in this release.


To access this fix, we suggest updating the package to version 34.1.30. We have also included the sample in the latest version for your reference.

Sample: Attached as a zip file.


Feedback: File Manager Context Menu Fails to Update Item Properties Dynamically in the MenuOpened Event in Blazor | Feedback Portal



Root cause: The context menu rendering logic was matching items using the Text property. Since Text is the same property change in the MenuOpened event (for example, renaming "New folder" to "Folder" or "Details" to "dd"), the comparison broke once the text was modified. As a result, the renderer reverted to the original locale value.

We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.

 

Regards,

Praveen Sellappan


Attachment: FileManagerSample_e5456b0a.zip

Loader.
Up arrow icon