SingleChoiceAction.FindItemByCaptionPath(String) Method

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

Namespace: DevExpress.ExpressApp.Actions

Assembly: DevExpress.ExpressApp.v18.2.dll

Declaration

public ChoiceActionItem FindItemByCaptionPath(
    string captionPath
)
Public Function FindItemByCaptionPath(
    captionPath As String
) As ChoiceActionItem

Parameters

Type Name Description
String captionPath

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

Returns

Type Description
ChoiceActionItem

A ChoiceActionItem with the specified caption path.

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