How to Use Spreadsheet Control Commands
- 3 minutes to read
In addition to built-in UI elements, context menus, and supported keystrokes, the ExpressSpreadSheet Suite includes a comprehensive set of commands implemented by action objects (TdxSpreadSheetAction descendants).

To implement a custom command-based UI in your application, you need to manually create the required action objects and associate them with one or more individual UI elements in your application, such as buttons, menus, ribbon, and toolbar items. To accomplish this goal, refer to the following step-by-step instructions:
Add the standard VCL TActionList component from the Component Palette to an application form or select an existing action list to store the required action object(s).
Double-click the TActionList component or click the Action List Editor… item in the context menu to display the action list editor.
Click the New Standard Action… item in the action list editor’s context menu to display the Standard Action Classes dialog.
Select the required action from the “DevExpress ExpressSpreadSheet” category and click the OK button.

- Select a control that has the Action property and assign the newly created action object to it using the Object Inspector.
Additionally, you can associate an action object with an icon. To do so, refer to the following instructions:
Place the TcxImageList component onto the application form and use the Image List Editor to populate the list with the required icons.
Set the populated image list as the action list’s Images property value.
Select a TdxSpreadSheetAction object in the action list’s editor and specify the required icon’s index within the image list as the action’s ImageIndex property value. As a result, the specified icon is displayed by all client controls that can display icons.
Each command has its own set of conditions that must be met for enabling all UI elements associated with it. For instance, all printing-related commands are available to end users only if the Spreadsheet control has a valid print link in the TdxComponentPrinter component.

Refer to action class descriptions to learn about the conditions for individual commands.
You can use most of the supported commands with any control that has the Action property. However, commands that allow end users to assign specific values (like changing the active font typeface and/or size, cell background color, etc.) instead of performing simple predefined operations (such as invoking a dialog, applying/removing a font attribute, etc.), are designed to be used with bar item editors, including but not limited to, TdxRibbonColorGalleryItem, TcxFontNameComboBox, and TcxComboBox components. All action classes that correspond to these commands are derived from TdxSpreadSheetValueAction. If you need to associate such a command with a custom client control, re-implement the command’s functionality in its OnExecute event handler. For detailed information and code examples, refer to the action class descriptions of each specific command: