Class RichTextEditorEvents
A class used for configuring the SfRichTextEditor component events.
Inheritance
Namespace: Syncfusion.Blazor.RichTextEditor
Assembly: Syncfusion.Blazor.dll
Syntax
public class RichTextEditorEvents : ComponentBase
Constructors
RichTextEditorEvents()
Declaration
public RichTextEditorEvents()
Properties
AfterPasteCleanup
Gets or sets the event callback that will be invoked after pasting the copied content into the editor.
Declaration
public EventCallback<PasteCleanupArgs> AfterPasteCleanup { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<PasteCleanupArgs> | An event callback function. |
Remarks
This event is used for handling any additional actions required once paste actions have occurred, such as logging or adjusting formatting.
BeforePasteCleanup
Gets or sets the event callback that will be invoked before pasting the copied content into the editor.
Declaration
public EventCallback<PasteCleanupArgs> BeforePasteCleanup { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<PasteCleanupArgs> | An event callback function. |
Remarks
Use this event to manage content paste operations, allowing custom handling before the insert operation completes.
BeforeUploadImage
Gets or sets the event callback that will be invoked when a selected image begins uploading to the server.
Declaration
public EventCallback<ImageUploadingEventArgs> BeforeUploadImage { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<ImageUploadingEventArgs> | An event callback function. |
Remarks
You can pass custom parameters in key-value pair format using CustomFormData during the XHR request for the image upload action. This is useful for modifying default upload behavior or passing additional data during the upload process.
Examples
@using Syncfusion.Blazor.RichTextEditor;
<SfRichTextEditor>
<RichTextEditorEvents BeforeUploadImage="OnImageUploading"/>
</SfRichTextEditor>
@code {
public void OnImageUploading(ImageUploadingEventArgs args) {
// adding custom Form Data
args.CustomFormData = new List<object> {new { path = "Your path"}};
}
}
Blur
Gets or sets the event callback that will be invoked when the SfRichTextEditor loses focus.
Declaration
public EventCallback<BlurEventArgs> Blur { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<BlurEventArgs> | An event callback function. |
Remarks
Use this event to execute any logic that should occur when the editor loses focus, such as validation or saving content.
Created
Gets or sets the event callback that will be invoked when the SfRichTextEditor is rendered.
Declaration
public EventCallback<object> Created { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<System.Object> | An event callback function. |
Remarks
This event is useful for performing actions immediately after the editor is rendered, like setting up custom plugins or UI components.
Destroyed
Gets or sets the event callback that will be invoked when the SfRichTextEditor is destroyed.
Declaration
public EventCallback<DestroyedEventArgs> Destroyed { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<DestroyedEventArgs> | An event callback function. |
Remarks
Use this event to release resources or perform other clean-up activities when the editor is being destroyed.
DialogClosed
Gets or sets the event callback that will be invoked after the SfRichTextEditor dialog is closed.
Declaration
public EventCallback<DialogCloseEventArgs> DialogClosed { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<DialogCloseEventArgs> | An event callback function. |
Remarks
Implement this event to handle tasks that need to occur immediately after the dialog closes, such as updating other UI elements or triggers.
DialogOpened
Gets or sets the event callback that will be invoked after the SfRichTextEditor dialog is opened.
Declaration
public EventCallback<DialogOpenEventArgs> DialogOpened { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<DialogOpenEventArgs> | An event callback function. |
Remarks
This event can be used to customize the dialog's appearance or set default values upon opening.
FileRemoving
Gets or sets the event callback that will be invoked when a selected media is removed from the upload location.
Declaration
public EventCallback<RemovingEventArgs> FileRemoving { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<RemovingEventArgs> | An event callback function. |
Remarks
You can pass custom parameters in key-value pair format using CustomFormData during the XHR request for media removal actions. This is useful for handling permissions or data consistency when removing media files.
Examples
@using Syncfusion.Blazor.RichTextEditor;
@using Syncfusion.Blazor.Inputs;
<SfRichTextEditor>
<RichTextEditorEvents FileRemoving="FileRemoveHandler" />
</SfRichTextEditor>
@code {
public void FileRemoveHandler(RemovingEventArgs args) {
// adding custom Form Data
args.CustomFormData = new List<object> {new { path = "Your path"}};
}
}
FileSelected
Gets or sets the event callback that will be invoked when media is selected or dragged into the insert media dialog.
Declaration
public EventCallback<SelectedEventArgs> FileSelected { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<SelectedEventArgs> | An event callback function. |
Remarks
You can prevent the media selection action by using Cancel. This is beneficial for controlling content input and ensuring proper handling of media files.
Examples
@using Syncfusion.Blazor.RichTextEditor;
@using Syncfusion.Blazor.Inputs;
<SfRichTextEditor>
<RichTextEditorEvents FileSelected="FileSelectionHandler" />
</SfRichTextEditor>
@code {
public void FileSelectionHandler(SelectedEventArgs args) {
args.Cancel = true;
}
}
FileUploadChange
Gets or sets the event callback that will be invoked when a media file is successfully uploaded and inserted into the editor content.
Declaration
public EventCallback<FileUploadChangeEventArgs> FileUploadChange { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<FileUploadChangeEventArgs> | An event callback function. |
Remarks
This event can be used for activities related to media, such as logging, updating the UI, or storing metadata.
FileUploadFailed
Gets or sets the event callback that will be invoked when the media upload process fails.
Declaration
public EventCallback<FileUploadFailedEventArgs> FileUploadFailed { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<FileUploadFailedEventArgs> | An event callback function. |
Remarks
Implement this event to manage actions upon media upload failure, like logging the error or instructing the user to try again.
FileUploading
Gets or sets the event callback that will be invoked when selected media begins uploading to the server.
Declaration
public EventCallback<FileUploadingEventArgs> FileUploading { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<FileUploadingEventArgs> | An event callback function. |
Remarks
You can pass custom parameters in key-value pair format using CustomFormData during the XHR request for the media upload action. This is helpful for customizing media upload behavior or including additional information with the upload.
Examples
@using Syncfusion.Blazor.RichTextEditor;
<SfRichTextEditor>
<RichTextEditorEvents FileUploading="OnMediaUploading"/>
</SfRichTextEditor>
@code {
public void OnMediaUploading(FileUploadingEventArgs args) {
// adding custom Form Data
args.CustomFormData = new List<object> {new { path = "Your path"}};
}
}
FileUploadSuccess
Gets or sets the event callback that will be invoked when media is successfully uploaded.
Declaration
public EventCallback<FileUploadSuccessEventArgs> FileUploadSuccess { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<FileUploadSuccessEventArgs> | An event callback function. |
Remarks
Use this event as a trigger for any post-upload actions like notifying a server, refreshing data, or updating UI components.
Focus
Gets or sets the event callback that will be invoked when the SfRichTextEditor gains focus.
Declaration
public EventCallback<FocusEventArgs> Focus { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<FocusEventArgs> | An event callback function. |
Remarks
Utilize this event to execute actions when the editor gains focus, such as highlighting UI elements or modifying the editor's toolbar.
ImageDelete
Gets or sets the event callback that will be invoked when the selected image is deleted from the editor content.
Declaration
public EventCallback<AfterImageDeleteEventArgs> ImageDelete { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<AfterImageDeleteEventArgs> | An event callback function. |
Remarks
This event is useful for handling the removal of images, such as updating the editor's state or notifying users.
ImageUploadChange
Gets or sets the event callback that will be invoked when an image is successfully uploaded and inserted into the editor content.
Declaration
public EventCallback<ImageUploadChangeEventArgs> ImageUploadChange { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<ImageUploadChangeEventArgs> | An event callback function. |
Remarks
Use this event to notify users or confirm the successful upload and insertion of an image.
MediaDeleted
Gets or sets the event callback that will be invoked when the selected media is deleted from the editor content.
Declaration
public EventCallback<MediaDeletedEventArgs> MediaDeleted { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<MediaDeletedEventArgs> | An event callback function. |
Remarks
Implement this event to manage actions related to media deletion, such as cleaning up resources or editing log entries.
OnActionBegin
Gets or sets the event callback that will be invoked before commands are executed using either toolbar item clicks or the Syncfusion.Blazor.RichTextEditor.SfRichTextEditor.ExecuteCommand(Syncfusion.Blazor.RichTextEditor.CommandName) method call.
Declaration
public EventCallback<ActionBeginEventArgs> OnActionBegin { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<ActionBeginEventArgs> | An event callback function. |
Remarks
You can prevent the execution of the current action by using Cancel.
Examples
@using Syncfusion.Blazor.RichTextEditor;
<SfRichTextEditor>
<RichTextEditorEvents OnActionBegin="ActionBeginHandler" />
</SfRichTextEditor>
@code {
public void ActionBeginHandler(ActionBeginEventArgs args) {
args.Cancel = true;
}
}
OnActionComplete
Gets or sets the event callback that will be invoked after commands are executed using toolbar item clicks or the Syncfusion.Blazor.RichTextEditor.SfRichTextEditor.ExecuteCommand(Syncfusion.Blazor.RichTextEditor.CommandName) method call.
Declaration
public EventCallback<ActionCompleteEventArgs> OnActionComplete { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<ActionCompleteEventArgs> | An event callback function. |
Remarks
This event allows you to react to changes made by command execution, such as logging the action or updating UI elements.
OnDialogClose
Gets or sets the event callback that will be invoked before the editor dialog closes.
Declaration
public EventCallback<BeforeCloseEventArgs> OnDialogClose { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<BeforeCloseEventArgs> | An event callback function. |
Remarks
You can prevent the dialog from closing by using Cancel. This is useful to confirm actions or validate data.
Examples
@using Syncfusion.Blazor.RichTextEditor;
@using Syncfusion.Blazor.Popups;
<SfRichTextEditor>
<RichTextEditorEvents OnDialogClose="DialogCloseHandler" />
</SfRichTextEditor>
@code {
public void DialogCloseHandler(BeforeCloseEventArgs args) {
args.Cancel = true;
}
}
OnDialogOpen
Gets or sets the event callback that will be invoked before the editor dialog opens.
Declaration
public EventCallback<BeforeOpenEventArgs> OnDialogOpen { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<BeforeOpenEventArgs> | An event callback function. |
Remarks
You can prevent the dialog from opening by using Cancel. This is useful for pre-dialog logic, such as setting conditions or modifying dialog content.
OnImageDrop
Gets or sets the event callback that will be invoked when an image is being dropped into the editor content.
Declaration
public EventCallback<BeforeImageDropEventArgs> OnImageDrop { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<BeforeImageDropEventArgs> | An event callback function. |
Remarks
You can prevent the image drag-and-drop action by using Cancel. This is useful for managing content integrity or user permissions.
Examples
@using Syncfusion.Blazor.RichTextEditor;
<SfRichTextEditor>
<RichTextEditorEvents OnImageDrop="ImageDragHandler" />
</SfRichTextEditor>
@code {
public void ImageDragHandler(BeforeImageDropEventArgs args) {
args.Cancel = true;
}
}
OnImageRemoving
Gets or sets the event callback that will be invoked when a selected image is removed from the upload location.
Declaration
public EventCallback<RemovingEventArgs> OnImageRemoving { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<RemovingEventArgs> | An event callback function. |
Remarks
You can pass custom parameters in key-value pair format using CustomFormData during the XHR request for image removal actions. This is helpful for tracking image usage or handling custom server logic.
Examples
@using Syncfusion.Blazor.RichTextEditor;
@using Syncfusion.Blazor.Inputs;
<SfRichTextEditor>
<RichTextEditorEvents OnImageRemoving="FileRemoveHandler" />
</SfRichTextEditor>
@code {
public void FileRemoveHandler(RemovingEventArgs args) {
// adding custom Form Data
args.CustomFormData = new List<object> {new { path = "Your path"}};
}
}
OnImageSelected
Gets or sets the event callback that will be invoked when an image is selected or dragged into the insert image dialog.
Declaration
public EventCallback<SelectedEventArgs> OnImageSelected { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<SelectedEventArgs> | An event callback function. |
Remarks
You can prevent the image selection action by using Cancel. This is useful for enforcing content policies or managing user permissions.
Examples
@using Syncfusion.Blazor.RichTextEditor;
@using Syncfusion.Blazor.Inputs;
<SfRichTextEditor>
<RichTextEditorEvents OnImageSelected="ImageSelectionHandler" />
</SfRichTextEditor>
@code {
public void ImageSelectionHandler(SelectedEventArgs args) {
args.Cancel = true;
}
}
OnImageUploadFailed
Gets or sets the event callback that will be invoked when the image upload process fails.
Declaration
public EventCallback<ImageFailedEventArgs> OnImageUploadFailed { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<ImageFailedEventArgs> | An event callback function. |
Remarks
Use this event to handle errors that occur during image upload, such as displaying a notification or retrying the upload.
OnImageUploadSuccess
Gets or sets the event callback that will be invoked when an image is successfully uploaded.
Declaration
public EventCallback<ImageSuccessEventArgs> OnImageUploadSuccess { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<ImageSuccessEventArgs> | An event callback function. |
Remarks
This event can be used to acknowledge successful image uploads or perform subsequent actions after the upload completes.
OnQuickToolbarOpen
Gets or sets the event callback that will be invoked before the quick toolbar opens.
Declaration
public EventCallback<BeforeQuickToolbarOpenArgs> OnQuickToolbarOpen { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<BeforeQuickToolbarOpenArgs> | An event callback function. |
Remarks
You can prevent the quick toolbar opening action by using Cancel. This is useful for modifying the toolbar options or preventing it based on specific conditions.
Examples
@using Syncfusion.Blazor.RichTextEditor;
<SfRichTextEditor>
<RichTextEditorEvents OnQuickToolbarOpen="QuickToobarHandler" />
</SfRichTextEditor>
@code {
public void QuickToobarHandler(BeforeQuickToolbarOpenArgs args) {
args.Cancel = true;
}
}
OnResizeStart
Gets or sets the event callback that will be invoked when you start resizing an image.
Declaration
public EventCallback<ResizeArgs> OnResizeStart { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<ResizeArgs> | An event callback function. |
Remarks
Use this event to perform actions when image resizing starts, such as locking aspect ratio or preparing to save changes.
OnResizeStop
Gets or sets the event callback that will be invoked when you stop resizing an image.
Declaration
public EventCallback<ResizeArgs> OnResizeStop { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<ResizeArgs> | An event callback function. |
Remarks
This event can be used to finalize any logic after image resizing is complete, such as updating the database with the new image dimensions.
OnToolbarClick
Gets or sets the event callback that will be invoked when the toolbar items are clicked.
Declaration
public EventCallback<ToolbarClickEventArgs> OnToolbarClick { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<ToolbarClickEventArgs> | An event callback function. |
Remarks
You can prevent the toolbar item click action using Cancel. This is useful for customizing toolbar behavior or adding custom actions.
Examples
@using Syncfusion.Blazor.RichTextEditor;
<SfRichTextEditor>
<RichTextEditorEvents OnToolbarClick="ToobarHandler" />
</SfRichTextEditor>
@code {
public void ToobarHandler(ToolbarClickEventArgs args) {
args.Cancel = true;
}
}
QuickToolbarClosed
Gets or sets the event callback that will be invoked after the quick toolbar has been closed.
Declaration
public EventCallback<QuickToolbarEventArgs> QuickToolbarClosed { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<QuickToolbarEventArgs> | An event callback function. |
Remarks
Implement this event to perform any cleanup or update operations after the quick toolbar is closed.
QuickToolbarOpened
Gets or sets the event callback that will be invoked after the quick toolbar is opened.
Declaration
public EventCallback<QuickToolbarEventArgs> QuickToolbarOpened { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<QuickToolbarEventArgs> | An event callback function. |
Remarks
Use this event to initialize components or perform specific actions when the quick toolbar appears.
UpdatedToolbarStatus
Gets or sets the event callback that will be invoked when the toolbar items status is updated.
Declaration
public EventCallback<ToolbarStatusEventArgs> UpdatedToolbarStatus { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<ToolbarStatusEventArgs> | An event callback function. |
Remarks
Use this event to update UI elements or perform tasks based on the toolbar items' status change.
ValueChange
Gets or sets the event callback that will be invoked when the editor content changes either on each SaveInterval time or when the editor loses focus.
Declaration
public EventCallback<ChangeEventArgs> ValueChange { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<ChangeEventArgs> | An event callback function. |
Remarks
This event is beneficial for saving content automatically or triggering change notifications in your application.
Examples
@using Syncfusion.Blazor.RichTextEditor;
<SfRichTextEditor>
<RichTextEditorEvents ValueChange="OnValueChange"/>
</SfRichTextEditor>
@code {
public void OnValueChange(Syncfusion.Blazor.RichTextEditor.ChangeEventArgs args) {
// Get Rich Text Editor updated value.
var RTEValue = args.Value;
}
}
Methods
OnInitializedAsync()
Method invoked when the component is ready to start.
Declaration
protected override Task OnInitializedAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A System.Threading.Tasks.Task representing any asynchronous operation. |