ComboBoxItemCollection.Remove(String) Method
Removes an item with the specified text from the combo box editor’s item collection.
Namespace: DevExpress.Blazor.Office
Assembly: DevExpress.Blazor.v24.2.dll
NuGet Package: DevExpress.Blazor
Declaration
public bool Remove(
string text
)
Parameters
Name | Type | Description |
---|---|---|
text | String | The item text. |
Returns
Type | Description |
---|---|
Boolean |
|
Remarks
<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