Back to Devexpress

BarItemCollectionBase<T>.Item[String] Property

blazor-devexpress-dot-blazor-dot-office-dot-baritemcollectionbase-1-dot-item-x28-system-dot-string-x29.md

latest1.6 KB
Original Source

BarItemCollectionBase<T>.Item[String] Property

Returns a bar item by its name.

Namespace : DevExpress.Blazor.Office

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
public T this[string name] { get; }

Parameters

NameTypeDescription
nameString

The item name.

|

Property Value

TypeDescription
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.

razor
<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

BarItemCollectionBase<T> Class

BarItemCollectionBase<T> Members

DevExpress.Blazor.Office Namespace