Skip to main content
.NET 6.0+

SingleChoiceAction.FindItemByCaptionPath(String) Method

Provides access to the SingleChoiceAction‘s ChoiceActionItem with the specified caption path.

Namespace: DevExpress.ExpressApp.Actions

Assembly: DevExpress.ExpressApp.v23.2.dll

NuGet Package: DevExpress.ExpressApp

Declaration

public ChoiceActionItem FindItemByCaptionPath(
    string captionPath
)

Parameters

Name Type Description
captionPath String

A string that represents the full caption path to the required ChoiceActionItem.

Returns

Type Description
ChoiceActionItem

A ChoiceActionItem with the specified caption path.

Remarks

Each item of a Choice Action has a caption path associated with it. This path is represented by a sequence of parent item captions separated by the slash character. Use the FindItemByCaptionPath method to access a particular item by specifying the path associated with it. If an item with the specified path is not found, this method returns null (Nothing in VB). To retrieve the caption path of a Choice Action Item, use the ChoiceActionItem.GetCaptionPath method.

The following snippet illustrates how to disable the SetTaskAction Action’s “Priority/High” item when the current user is “John”.

ChoiceActionItem priorityHighItem = SetTaskAction.FindItemByCaptionPath("Priority/High");
if (priorityHighItem != null) 
    priorityHighItem.Enabled.SetItemValue(
        "SecurityAllowance", SecuritySystem.CurrentUserName != "John");

FindItemByCaptionPath

Alternatively, you can use the SingleChoiceAction.FindItemByIdPath Method, to find a specific item by its ID path.

See Also