Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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

C#
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:

Razor
<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