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.Clear() Method

In This Article

Removes all items 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 void Clear()

#Remarks

The following code snippet removes all items from the Font combo box.

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.Clear();
        }
    }
}
See Also