Skip to main content
A newer version of this page is available. .

ASPxClientFileManager.GetContextMenuItemByCommandName(commandName) Method

Returns a context menu item specified by its command name.

Declaration

GetContextMenuItemByCommandName(
    commandName: string
): ASPxClientFileManagerToolbarItem

Parameters

Name Type Description
commandName string

A string value specifying the command name of the item.

Returns

Type Description
ASPxClientFileManagerToolbarItem

An ASPxClientFileManagerToolbarItem object that is the item with the specified command name.

Remarks

Use the GetContextMenuItemByCommandName method to get a context menu item object specified by its command name. An item’s command name is defined by the FileManagerToolbarItemBase.CommandName property.

This method searches for the specified item amongst all items contained in the FileManagerSettingsContextMenu.Items collection. Note that if an invalid name is passed via the parameter, this method returns null.

Note

The GetContextMenuItemByCommandName method can be used to get custom context menu items only.

A public API for getting access to standard items in the context menu or on the toolbar is not provided. The standard items are created by ASPxFileManager, and if you change them, you can change the logic of the ASPxFileManager functionality.

Example

The complete sample is available in the 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