Skip to main content

Context Menu

The ASPxFileManager context menu is a popup menu displayed when a user right-clicks a file manager element. To enable the context menu, use the FileManagerSettingsContextMenu.Enabled property.

ASPxFileManager_ContextMenu

The FileManagerSettingsContextMenu.Items property allows you to populate the menu item collection with default and custom items. If the item collection is empty, default items are displayed.

When a file manager updates its context menu, the ASPxClientFileManager.ToolbarUpdating event is raised. This event allows you to change item availability. You can use the event argument’s ASPxClientFileManagerToolbarUpdatingEventArgs.activeAreaName property to determine the currently active area. To access a specific context menu item, use the ASPxClientFileManager.GetContextMenuItemByCommandName method.

Example

The complete example is available in the following DevExpress online demo: File Manager - Custom Toolbar.

function OnToolbarUpdating(s, e) {
     var enabled = (e.activeAreaName == "Folders" || FileManager.GetSelectedItems().length > 0) && e.activeAreaName != "None";
     FileManager.GetContextMenuItemByCommandName ("Properties").SetEnabled(enabled);
}
See Also