Skip to main content

BarItemCollectionBase<T>.Item[Int32] Property

Returns a bar item by its index.

Namespace: DevExpress.Blazor.Office

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

public T this[int index] { get; }

Parameters

Name Type Description
index Int32

The item index.

Property Value

Type Description
T

The item type.

Remarks

You can get a bar item by its name or index.

The following code snippet demonstrates how to access the ribbon’s items.

<DxRichEdit CustomizeRibbon=OnCustomizeRibbon />

@code {

    void OnCustomizeRibbon(IRibbon ribbon) {
        IRibbonTab homeTab = ribbon.Tabs[RichEditRibbonTabNames.Home];
        IBarGroup fontGroup = homeTab.Groups[RichEditRibbonGroupNames.HomeFont];
        // Returns the first item
        IBarItem firstItem = fontGroup.Item[0];
        // Returns the "Font Size" item
        IBarItem fontSizeItem = fontGroup.Items[RichEditBarItemNames.FontSize];
    }
}
See Also