New to Telerik UI for Blazor? Start a free 30-day trial

FileManager Context Menu

Updated on Oct 27, 2026

The ContextMenu of the FileManager enables you to easily execute commands on the selected file or folder.

The component uses the Telerik UI for Blazor ContextMenu and provides the following commands:

Rename

The Rename command of the FileManager ContextMenu allows renaming the selected file or folder. Users can rename one item at a time - the one they open the ContextMenu for.

Clicking the command will fire the OnEdit event. An input with the file/folder name will be rendered, so the user can edit it. Pressing Enter or blurring the input will fire the OnUpdate event allowing you can handle the name update of the actual item in your data source.

When an item is renamed, make sure to also update its Path. Renaming a directory that has children will require updating their Path as well. If the actual file system is modified, then this will be handled out of the box.

Download

The Download command of the FileManager ContextMenu allows downloading of the selected file.

Clicking the command will fire the OnDownload event, so you can handle the actual download.

The component does not have the actual files, so the Item field of the FileManagerDownloadEventArgs just provide metadata of the selected file. Based on that, you should find the actual in the file system you are using and provide the following data to the arguments, so the download can be performed:

  • args.Stream - the MemoryStream of the actual selected file.
  • args.MimeType - the MimeType of the actual file, e.g. "image/png".

In addition, you can also provide a custom file name through the FileName field of the FileManagerDownloadEventArgs.

Delete

The Delete command of the FileManager ContextMenu allows deleting of the selected files. Multiple file deletion is supported. It does not matter which item the ContextMenu for, the Delete command will handle the deletion of all selected files.

Clicking the command will open a delete confirmation dialog. Pressing the OK button will fire the OnDelete event, so you can handle the deletion of the actual files in the data source. Pressing the Cancel button will close the dialog and prevent the deletion.

Customization

Configure the context menu through the FileManagerContextMenuSettings tag and its Data parameter. Provide a collection of FileManagerContextMenuItem objects, and assign each item's CommandName to one of the following FileManagerCommands string values to retain the built-in FileManager behavior:

  • FileManagerCommands.Rename
  • FileManagerCommands.Download
  • FileManagerCommands.Delete

A custom CommandName value triggers the OnClick event of FileManagerContextMenuSettings, where you can implement the required action. The FileManager OnContextMenu event lets you provide different menu items for each file or folder. To prevent the menu from opening for a specific item, set args.IsCancelled to true.

The following example defines custom commands, changes the available commands by item type, and disables the context menu for a specific file.

Example
View Source
Loading ...

Example

The following example demonstrates handling of the ContextMenu commands.

Example
View Source
Loading ...

See Also