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

DxRichEdit.BarItemExceptionRaised Event

Allows you to handle exceptions that occur after a user interacts with an item in the menu bar.

Namespace: DevExpress.Blazor.RichEdit

Assembly: DevExpress.Blazor.RichEdit.v24.2.dll

NuGet Package: DevExpress.Blazor.RichEdit

#Declaration

C#
[Parameter]
public EventCallback<BarItemExceptionEventArgs> BarItemExceptionRaised { get; set; }

#Event Data

The BarItemExceptionRaised event's data class is BarItemExceptionEventArgs. The following properties provide information specific to this event:

Property Description
Exception Returns an exception that details the cause of the failure.
Handled Gets or sets a value that indicates whether the event handler has completely handled the event or whether the system should continue its own processing. Inherited from HandledEventArgs.

#Remarks

The Rich Text Editor runs asynchronous code to respond to user actions. Use the BarItemExceptionRaised event to handle runtime exceptions that occur after a user interacts with a build-in or custom item in the menu bar.

The following code snippet writes log messages for exeptions that occur after a user interacts with a custom ribbon:

@inject ILogger<RibbonCustomization> Logger;
@using Microsoft.Extensions.Logging;

<DxRichEdit CustomizeRibbon=OnCustomizeRibbon />

@code {
    void OnCustomizeRibbon(IRibbon ribbon) {
        // ...
    }
    void OnBarItemExceptionRaised(BarItemExceptionEventArgs args) {
        Logger.LogError(args.Exception, args.Exception.Message);
        args.Handled = true;
    }
}
See Also