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

IBarButton.Click Property

Specifies the button’s Click event handler.

Namespace: DevExpress.Blazor.Office

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
Func<Task> Click { get; set; }

#Property Value

Type Description
Func<Task>

A delegate method that handles the Click event.

#Remarks

The following code snippet disables the Insert Field drop-down button on the Mail Merge ribbon tab. To do this, set the Click event handler to null.

Razor
<DxRichEdit @ref=@rich CustomizeRibbon=OnCustomizeRibbon />

@code {
    DxRichEdit rich;

    void OnCustomizeRibbon(IRibbon ribbon) {
        RibbonTabCollection tabs = ribbon.Tabs;
        DisableFieldDropDownCommandButton(tabs);
    }

    void DisableFieldDropDownCommandButton(RibbonTabCollection tabs) {
        IRibbonTab mailMergeTab = tabs[RichEditRibbonTabNames.MailMerge];
        IBarGroup fieldsGroup = mailMergeTab.Groups[RichEditRibbonGroupNames.MailMergeInsertFields];
        IBarItem insertFieldItem = fieldsGroup.Items[RichEditBarItemNames.InsertFieldMenu];
        if (insertFieldItem.Type == BarItemTypes.DropDown) {
            IBarDropDown insertFieldDropDown = (IBarDropDown)insertFieldItem;
            insertFieldDropDown.Click = null;
        }
}

Run Demo: Ribbon Customization

See Also