IContextMenuItemCollection.Add(String) Method
In This Article
Adds a predefined item to the end of the item collection.
Namespace: DevExpress.Blazor.Office
Assembly: DevExpress.Blazor.v24.2.dll
NuGet Package: DevExpress.Blazor
#Declaration
C#
IContextMenuItem Add(
string name
)
#Parameters
Name | Type | Description |
---|---|---|
name | String | The item name. |
#Returns
Type | Description |
---|---|
IContext |
The inserted menu item. |
#Remarks
Add
method overloads allow you to add predefined items to the main context menu or its sub-menus. Use the RichEditContextMenuItemNames class properties to obtain names of all built-in items.
The following code snippet adds default Bring to Front and Bring in Front of Text items to the context menu:
Razor
<DxRichEdit CustomizeContextMenu=OnCustomizeContextMenu />
@code {
void OnCustomizeContextMenu(IContextMenuItemCollection items) {
// Inserts the "Bring to Front" item at the end of the item collection
items.Add(RichEditContextMenuItemNames.BringToFront);
// Inserts the "Bring in Front of Text" item at the first position in the item collection
items.Add(0, RichEditContextMenuItemNames.BringInFrontOfText);
}
}
See Also