IContextMenuItemCollection.Item[String] Property
Returns a context menu item with the specified name.
Namespace: DevExpress.Blazor.Office
Assembly: DevExpress.Blazor.v24.2.dll
NuGet Package: DevExpress.Blazor
Declaration
IContextMenuItem this[string name] { get; }
Parameters
Name | Type | Description |
---|---|---|
name | String | The item name. |
Property Value
Type | Description |
---|---|
IContextMenuItem | The context menu item. |
Remarks
You can obtain an item by its name or index. To obtain names of built-in items, use the RichEditContextMenuItemNames class properties.
The following code snippet demonstrates how to access root-level items of the context menu:
<DxRichEdit CustomizeContextMenu=OnCustomizeContextMenu />
@code {
void OnCustomizeContextMenu(IContextMenuItemCollection items) {
// Returns the first item
IContextMenuItem firstItem = items[0];
// Returns the "Increase Indent" item
IContextMenuItem increaseIndentItem = items[RichEditContextMenuItemNames.IncreaseIndent];
}
}
See Also