Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

BarItemCollectionBase<T>.Item[String] Property

Returns a bar item by its name.

Namespace: DevExpress.Blazor.Office

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
public T this[string name] { get; }

#Parameters

Name Type Description
name String

The item name.

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

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