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
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.
Disclaimer: The provided tentative release timeline is subject to change in the future based on development priorities and testing outcomes.
Regards,
Praveen Sellappan
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.
Sample: Attached as a zip file.
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
- 2 Replies
- 2 Participants
-
BR Bruno
- Jun 17, 2026 04:38 PM UTC
- Jul 10, 2026 02:49 PM UTC