Skip to main content
All docs
V25.2
  • IContextMenuItemCollection.Remove(String) Method

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

    Namespace: DevExpress.Blazor

    Assembly: DevExpress.Blazor.v25.2.dll

    NuGet Package: DevExpress.Blazor

    Declaration

    bool Remove(
        string name
    )

    Parameters

    Name Type Description
    name String

    Item name.

    Returns

    Type Description
    Boolean

    true if the item is removed; otherwise, false.

    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 Remove method to remove an item from the menu item collection.

    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);
        }
    }
    

    Refer to CustomizeContextMenu event descriptions for additional information and examples:

    See Also