Skip to main content

IBarButton.Click Property

Specifies the button’s Click event handler.

Namespace: DevExpress.Blazor.Office

Assembly: DevExpress.Blazor.v23.2.dll

NuGet Package: DevExpress.Blazor

Declaration

Func<Task> Click { get; set; }

Property Value

Type Description
Func<Task>

A delegate method that handles the Click event.

Remarks

The example below demonstrates how to disable the Insert Field drop-down button on the Mail Merge ribbon tab. To do this, set the Click event handler to null.

<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