Skip to main content
All docs
V24.1

IContextMenuItemCollection.Clear() Method

Removes all items from an item collection.

Namespace: DevExpress.Blazor.Office

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

void Clear()

Remarks

The following code snippet removes all items from the Text Wrap Menu:

<DxRichEdit CustomizeContextMenu="OnCustomizeContextMenu" />

@code {
    void OnCustomizeContextMenu(IContextMenuItemCollection items) {
        IContextMenuItem textWrapMenu = items[RichEditContextMenuItemNames.TextWrapMenu];
        if(textWrapMenu != null)
            textWrapMenu.Items.Clear();
    }
}

The following code snippet removes all root-level items:

<DxRichEdit CustomizeContextMenu="OnCustomizeContextMenu" />

@code {
    void OnCustomizeContextMenu(IContextMenuItemCollection items) {
        items.Clear();
    }
}
See Also