Back to Devexpress

IContextMenuItemCollection.AddCustomItem(String, Func<Task>, Boolean) Method

blazor-devexpress-dot-blazor-dot-icontextmenuitemcollection-dot-addcustomitem-x28-system-dot-string-system-dot-func-system-dot-threading-dot-tasks-dot-task-system-dot-boolean-x29.md

latest2.0 KB
Original Source

IContextMenuItemCollection.AddCustomItem(String, Func<Task>, Boolean) Method

Adds a custom menu item to the end of the item collection.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
IContextMenuItem AddCustomItem(
    string text,
    Func<Task> click,
    bool enabled
)

Parameters

NameTypeDescription
textString

Item caption.

| | click | Func<Task> |

A delegate method that handles the item’s Click event.

| | enabled | Boolean |

true to enable the item; false to disable it.

|

Returns

TypeDescription
IContextMenuItem

The inserted menu item.

|

Remarks

Handle the CustomizeContextMenu event to modify context commands available in the Grid, Rich Text Editor, or TreeList component. In the event handler, call the AddCustomItem method to add a custom command to the main context menu or its sub-menus.

Refer to CustomizeContextMenu event descriptions for additional information and examples:

See Also

IContextMenuItemCollection Interface

IContextMenuItemCollection Members

DevExpress.Blazor Namespace