Skip to main content
All docs
V24.2

IContextMenuItemCollection.Remove(String) Method

Removes an item with the specified name from an item collection.

Namespace: DevExpress.Blazor.Office

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

Declaration

bool Remove(
    string name
)

Parameters

Name Type Description
name String

The item name.

Returns

Type Description
Boolean

true if the item is removed; otherwise, false.

Remarks

Remove method overloads allow you to remove context menu items from item collections.

The following code snippet removes items from the main context menu:

<DxRichEdit CustomizeContextMenu="OnCustomizeContextMenu"/>

@code {
    void OnCustomizeContextMenu(IContextMenuItemCollection items) {
        // Removes the first item
        items.Remove(0);
        // Removes the "Decrease Indent" item
        items.Remove(RichEditContextMenuItemNames.DecreaseIndent);
    }
}

Run Demo: Context Menu Customization

See Also