IContextMenuItemCollection.Item[Int32] Property
Returns a context menu item with the specified index.
Namespace: DevExpress.Blazor.Office
Assembly: DevExpress.Blazor.v24.1.dll
NuGet Package: DevExpress.Blazor
Declaration
IContextMenuItem this[int index] { get; }
Parameters
Name | Type | Description |
---|---|---|
index | Int32 | The item’s index. |
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