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

ComboBoxItemCollection.Remove(Int32) Method

Removes an item with the specified index from the combo box editor’s item collection.

Namespace: DevExpress.Blazor.Office

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
public bool Remove(
    int index
)

#Parameters

Name Type Description
index Int32

The item index.

#Returns

Type Description
Boolean

true if the item is removed; otherwise, false.

#Remarks

Razor
<DxRichEdit CustomizeRibbon=OnCustomizeRibbon/>

@code {
    void OnCustomizeRibbon(IRibbon ribbon) {
        RibbonTabCollection tabs = ribbon.Tabs;
        RemoveItemsFromFontComboBox(tabs);
        // ...
    }

    void RemoveItemsFromFontComboBox(RibbonTabCollection tabs) {
        IRibbonTab homeTab = tabs[RichEditRibbonTabNames.Home];
        IBarGroup homeFontGroup = homeTab.Groups[RichEditRibbonGroupNames.HomeFont];
        IBarItem fontNameItem = homeFontGroup.Items[RichEditBarItemNames.FontName];
        if (fontNameItem.Type == BarItemTypes.ComboBox) {
            IBarComboBox fontNameComboBox = (IBarComboBox)fontNameItem;
            fontNameComboBox.Items.Remove("Arial");
            fontNameComboBox.Items.Remove(0);
        }
    }
}
See Also