Back to Devexpress

ActionBase.Caption Property

expressappframework-devexpress-dot-expressapp-dot-actions-dot-actionbase-70edf29d.md

latest7.0 KB
Original Source

ActionBase.Caption Property

Specifies an Action‘s caption.

Namespace : DevExpress.ExpressApp.Actions

Assembly : DevExpress.ExpressApp.v25.2.dll

NuGet Package : DevExpress.ExpressApp

Declaration

csharp
[DefaultValue("")]
public string Caption { get; set; }
vb
<DefaultValue("")>
Public Property Caption As String

Property Value

TypeDefaultDescription
StringString.Empty

A string property that represents the current Action’s caption.

|

Remarks

By default, this property is set to the ActionBase.Id property 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. In a UI, the value which is specified in the Application Model’s .xafml file, loaded last, will be displayed. For information on the order of Application Model differences loading, refer to the Application Model Basics topic.

When setting a value to this property, the View.CaptionChanged event is raised.

The following code snippets (auto-collected from DevExpress Examples) contain references to the Caption property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

xaf-win-custom-action-with-custom-action-control/CS/EFCore/CustomActionEF/CustomActionEF.Win/Controllers/SampleController.cs#L9

csharp
CheckableSimpleAction activeFilterAction = new CheckableSimpleAction(this, "ActiveFilterAction", PredefinedCategory.Filters);
activeFilterAction.Caption = "Active";
activeFilterAction.Execute += activeFilterAction_Execute;

XAF_generate-a-sequential-number-for-a-persistent-object-within-a-database-transaction/CS/XPO/Demo.Module/Controllers/TestListViewController.cs#L20

csharp
void testAction_Execute(object sender, SimpleActionExecuteEventArgs e) {
    testAction.Caption = "Test is running...";
    Task[] tasks = new Task[MaxTestersCount];

XAF_How-to-get-role-code-from-the-UI/CS/XPO/GenerateRole/GenerateRole.Module/Controllers/RoleGeneratorController.cs#L24

csharp
roleGeneratorAction = new SimpleAction(components);
roleGeneratorAction.Caption = "Generate Role";
roleGeneratorAction.Category = "Tools";

XAF_logon-form-manage-users-register-a-new-user-restore-a-password/CS/EFCore/Security.Extensions/ManageUsersOnLogonController.cs#L53

csharp
SimpleAction action = new SimpleAction(this, id, category);
action.Caption = caption;
action.ImageName = imageName;

xaf-custom-action-type-blazor/CS/CustomActionSolution/CustomActionSolution.Blazor.Server/Controllers/SampleController.cs#L14

csharp
activeFilterAction = new CheckableSimpleAction(this, "ActiveFilterAction", PredefinedCategory.Filters);
activeFilterAction.Caption = "Active";
activeFilterAction.Execute += ActiveFilterAction_Execute; ;

XAF_generate-a-sequential-number-for-a-persistent-object-within-a-database-transaction/VB/Demo.Module/Controllers/TestListViewController.vb#L22

vb
Private Sub testAction_Execute(ByVal sender As Object, ByVal e As SimpleActionExecuteEventArgs)
    testAction.Caption = "Test is running..."
    Dim tasks(MaxTestersCount - 1) As Task

xaf-how-to-import-data-in-xaf/VB/WinWebSolution.Module/ImportDataListViewController.vb#L32

vb
Dim item2 As New ChoiceActionItem()
importDataAction_Renamed.Caption = "Import Data"
importDataAction_Renamed.ImageName = "Attention"

XAF-search-objects-using-complex-criterion/VB/Dennis.Search.Win/SearchObjectViewController.vb#L24

vb
AddHandler scaSearchObjectActionCore.Execute, AddressOf saSearchObjectActionCore_Execute
scaSearchObjectActionCore.Caption = Properties.Resources.SearchObjectActionText
scaSearchObjectActionCore.ImageName = "Action_Search"

See Also

ActionBase Class

ActionBase Members

DevExpress.ExpressApp.Actions Namespace