Skip to main content
All docs
V24.1

IContextMenuItemCollection.Remove(Int32) Method

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

Namespace: DevExpress.Blazor.Office

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

bool Remove(
    int index
)

Parameters

Name Type Description
index Int32

The item index.

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