Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+

ActionBase.Category Property

Specifies an Action‘s category.

Namespace: DevExpress.ExpressApp.Actions

Assembly: DevExpress.ExpressApp.v19.2.dll

Declaration

[TypeConverter(typeof(ActionCategoryConverter))]
[DefaultValue("Unspecified")]
public string Category { get; set; }

Property Value

Type Default Description
String "Unspecified"

A String value that represents a Category for the current Action.

Remarks

To specify in which Action Container the current Action will be displayed, specify the Action’s Category property. For this purpose, use one of the predefined categories that correspond to Action Containers used by built-in Templates. Use the DevExpress.Persistent.Base.PredefinedCategory enumeration to get the required predefined category. For an example, see Add an Action to a Controller.

By default, this property is set to the DevExpress.Persistent.Base.PredefinedCategory.Unspecified value. You can set another value in the Controller’s constructor or Designer. This value will be saved to the Application Model‘s ActionDesign | Actions | <Action> node. You can change this value via the Model Editor (see Place an Action in a Different Location and How to: Reorder an Action Container’s Actions Collection). In a UI, the value specified in the Application Model’s .xafml file that was loaded last will be displayed. For information on the load order of Application Model differences, refer to the Application Model Basics topic.

If you leave this property set to Unspecified, the Action will be displayed by the Action Container that is set to the current Template‘s DefaultContainer property. Note that a Template may return null by this property. So, we recommend that you assign the required category to the Action’s Category property. In this instance, the Action will be displayed by the corresponding Action Container, if this Container is contained in the current Template.

How to Add an Action to a Context Menu or Command Column

There are Action Containers that are displayed in the Context Menu, but are not displayed anywhere else. If you want to show an Action only in the Context Menu (in WinForms) or in a ListView column (in ASP.NET), specify the ID of one of these Action Containers in the Action’s Category property. These are the “Menu” category in WinForms and “ListView” category in ASP.NET. To see where a certain Action Container is located, add a custom template to your application and open it in the designer

In any Template that contains a List View, a set of Action Containers are displayed in the context menu, which can be invoked for the List View. The Default Container is not added to this menu. So, Actions with the Unspecified category are not displayed in a List View’s context menu.

To examine how Actions are mapped to Action Containers in your application, see the ActionDesign | ActionToContainerMapping node in the Model Editor.

See Also