Demos About Radzen
Search Results for

    Show / Hide Table of Contents

    Class RadzenHtmlEditor

    A component which edits HTML content. Provides built-in upload capabilities.

    Inheritance
    System.Object
    RadzenComponent
    FormComponent<System.String>
    RadzenHtmlEditor
    Implements
    IDisposable
    IRadzenFormComponent
    Inherited Members
    FormComponent<String>.Name
    FormComponent<String>.TabIndex
    FormComponent<String>.Placeholder
    FormComponent<String>.Disabled
    FormComponent<String>.EditContext
    FormComponent<String>.Form
    FormComponent<String>.ValueChanged
    FormComponent<String>.HasValue
    FormComponent<String>.IsBound
    FormComponent<String>._value
    FormComponent<String>.Value
    FormComponent<String>.Change
    FormComponent<String>.FieldIdentifier
    FormComponent<String>.ValueExpression
    FormComponent<String>.GetValue()
    FormComponent<String>.OnContextMenu(MouseEventArgs)
    FormComponent<String>.GetClassList(String)
    FormComponent<String>.FormFieldContext
    FormComponent<String>.CurrentPlaceholder
    RadzenComponent.Attributes
    RadzenComponent.Element
    RadzenComponent.MouseEnter
    RadzenComponent.MouseLeave
    RadzenComponent.ContextMenu
    RadzenComponent.Culture
    RadzenComponent.DefaultCulture
    RadzenComponent.OnMouseEnter()
    RadzenComponent.OnMouseLeave()
    RadzenComponent.OnContextMenu(Microsoft.AspNetCore.Components.Web.MouseEventArgs)
    RadzenComponent.Style
    RadzenComponent.Visible
    RadzenComponent.GetCssClass()
    RadzenComponent.GetId()
    RadzenComponent.Debounce(Func<Task>, Int32)
    RadzenComponent.UniqueID
    RadzenComponent.JSRuntime
    RadzenComponent.IsJSRuntimeAvailable
    RadzenComponent.Reference
    RadzenComponent.RaiseContextMenu(Microsoft.AspNetCore.Components.Web.MouseEventArgs)
    RadzenComponent.RaiseMouseEnter()
    RadzenComponent.RaiseMouseLeave()
    RadzenComponent.CurrentStyle
    Namespace: Radzen.Blazor
    Assembly: Radzen.Blazor.dll
    Syntax
    public class RadzenHtmlEditor : FormComponent<string>, IDisposable, IRadzenFormComponent
    Examples
    <RadzenHtmlEditor @bind-Value=@html />
    @code {
      string html = "@lt;strong>Hello</strong> world!";
    }

    Properties

    ChildContent

    Gets or sets the child content.

    Declaration
    public RenderFragment ChildContent { get; set; }
    Property Value
    Type Description
    RenderFragment

    The child content.

    Execute

    A callback that will be invoked when the user executes a command of the editor (e.g. by clicking one of the tools).

    Declaration
    public EventCallback<HtmlEditorExecuteEventArgs> Execute { get; set; }
    Property Value
    Type Description
    EventCallback<HtmlEditorExecuteEventArgs>
    Examples
    <RadzenHtmlEditor Execute=@OnExecute>
      <RadzenHtmlEditorCustomTool CommandName="InsertToday" Icon="today" Title="Insert today" />
    </RadzenHtmlEditor>
    @code {
      string html = "@lt;strong>Hello</strong> world!";
      async Task OnExecute(HtmlEditorExecuteEventArgs args)
      {
        if (args.CommandName == "InsertToday")
        {
          await args.Editor.ExecuteCommandAsync(HtmlEditorCommands.InsertHtml, DateTime.Today.ToLongDateString());
        }
     }

    Input

    Gets or sets the input.

    Declaration
    public EventCallback<string> Input { get; set; }
    Property Value
    Type Description
    EventCallback<System.String>

    The input.

    Mode

    Gets or sets the mode of the editor.

    Declaration
    public HtmlEditorMode Mode { get; set; }
    Property Value
    Type Description
    HtmlEditorMode

    Paste

    A callback that will be invoked when the user pastes content in the editor. Commonly used to filter unwanted HTML.

    Declaration
    public EventCallback<HtmlEditorPasteEventArgs> Paste { get; set; }
    Property Value
    Type Description
    EventCallback<HtmlEditorPasteEventArgs>
    Examples
    <RadzenHtmlEditor @bind-Value=@html Paste=@OnPaste />
    @code {
      string html = "@lt;strong>Hello</strong> world!";
      void OnPaste(HtmlEditorPasteEventArgs args)
      {
        // Set args.Html to filter unwanted tags.
        args.Html = args.Html.Replace("<br>", "");
      }

    ShowToolbar

    Specifies whether to show the toolbar. Set it to false to hide the toolbar. Default value is true.

    Declaration
    public bool ShowToolbar { get; set; }
    Property Value
    Type Description
    System.Boolean

    UploadComplete

    Gets or sets the callback which when a file is uploaded.

    Declaration
    public EventCallback<UploadCompleteEventArgs> UploadComplete { get; set; }
    Property Value
    Type Description
    EventCallback<UploadCompleteEventArgs>

    The complete callback.

    UploadError

    A callback that will be invoked when there is an error during upload.

    Declaration
    public EventCallback<UploadErrorEventArgs> UploadError { get; set; }
    Property Value
    Type Description
    EventCallback<UploadErrorEventArgs>

    UploadHeaders

    Specifies custom headers that will be submit during uploads.

    Declaration
    public IDictionary<string, string> UploadHeaders { get; set; }
    Property Value
    Type Description
    IDictionary<System.String, System.String>

    UploadUrl

    Specifies the URL to which RadzenHtmlEditor will submit files.

    Declaration
    public string UploadUrl { get; set; }
    Property Value
    Type Description
    System.String

    Methods

    Dispose()

    Disposes this instance.

    Declaration
    public override void Dispose()
    Overrides
    Radzen.FormComponent<System.String>.Dispose()

    ExecuteCommandAsync(String, String)

    Executes the requested command with the provided value. Check HtmlEditorCommands for the list of supported commands.

    Declaration
    public async Task ExecuteCommandAsync(string name, string value = null)
    Parameters
    Type Name Description
    System.String name

    The name.

    System.String value

    The value.

    Returns
    Type Description
    Task

    ExecuteShortcutAsync(String)

    Executes the action associated with the specified shortcut. Used internally by RadzenHtmlEditor.

    Declaration
    public async Task ExecuteShortcutAsync(string shortcut)
    Parameters
    Type Name Description
    System.String shortcut
    Returns
    Type Description
    Task

    FocusAsync()

    Focuses the editor.

    Declaration
    public override ValueTask FocusAsync()
    Returns
    Type Description
    ValueTask
    Overrides
    Radzen.FormComponent<System.String>.FocusAsync()

    GetComponentCssClass()

    Gets the component CSS class.

    Declaration
    protected override string GetComponentCssClass()
    Returns
    Type Description
    System.String
    Overrides
    RadzenComponent.GetComponentCssClass()

    GetHeaders()

    Invoked by interop during uploads. Provides the custom headers.

    Declaration
    public IDictionary<string, string> GetHeaders()
    Returns
    Type Description
    IDictionary<System.String, System.String>

    GetMode()

    Returns the current mode of the editor.

    Declaration
    public HtmlEditorMode GetMode()
    Returns
    Type Description
    HtmlEditorMode

    OnAfterRenderAsync(Boolean)

    Called by the Blazor runtime.

    Declaration
    protected override async Task OnAfterRenderAsync(bool firstRender)
    Parameters
    Type Name Description
    System.Boolean firstRender
    Returns
    Type Description
    Task
    Overrides
    RadzenComponent.OnAfterRenderAsync(Boolean)

    OnChange(String)

    Invoked via interop when the value of RadzenHtmlEditor changes.

    Declaration
    public void OnChange(string html)
    Parameters
    Type Name Description
    System.String html

    The HTML.

    OnError(String)

    Called on upload error.

    Declaration
    public async Task OnError(string error)
    Parameters
    Type Name Description
    System.String error

    The error.

    Returns
    Type Description
    Task

    OnInitialized()

    Called by the Blazor runtime.

    Declaration
    protected override void OnInitialized()
    Overrides
    RadzenComponent.OnInitialized()

    OnPaste(String)

    Invoked via interop when the user pastes content in RadzenHtmlEditor. Invokes Paste.

    Declaration
    public async Task<string> OnPaste(string html)
    Parameters
    Type Name Description
    System.String html

    The HTML.

    Returns
    Type Description
    Task<System.String>

    OnSelectionChange()

    Invoked by interop when the RadzenHtmlEditor selection changes.

    Declaration
    public async Task OnSelectionChange()
    Returns
    Type Description
    Task

    OnUploadComplete(String)

    Invoked by interop when the upload is complete.

    Declaration
    public async Task OnUploadComplete(string response)
    Parameters
    Type Name Description
    System.String response
    Returns
    Type Description
    Task

    RegisterShortcut(String, Func<Task>)

    Registers a shortcut for the specified action.

    Declaration
    public void RegisterShortcut(string key, Func<Task> action)
    Parameters
    Type Name Description
    System.String key

    The shortcut. Can be combination of keys such as CTRL+B.

    Func<Task> action

    The action to execute.

    RestoreSelectionAsync()

    Restores the last saved selection.

    Declaration
    public async Task RestoreSelectionAsync()
    Returns
    Type Description
    Task

    SaveSelectionAsync()

    Saves the current selection. RadzenHtmlEditor will lose its selection when it loses focus. Use this method to persist the current selection.

    Declaration
    public async Task SaveSelectionAsync()
    Returns
    Type Description
    Task

    SetParametersAsync(ParameterView)

    Sets the parameters asynchronous.

    Declaration
    public override async Task SetParametersAsync(ParameterView parameters)
    Parameters
    Type Name Description
    ParameterView parameters

    The parameters.

    Returns
    Type Description
    Task

    Task.

    Overrides
    Radzen.FormComponent<System.String>.SetParametersAsync(ParameterView)

    UnregisterShortcut(String)

    Unregisters the specified shortcut.

    Declaration
    public void UnregisterShortcut(string key)
    Parameters
    Type Name Description
    System.String key

    Implements

    IDisposable
    IRadzenFormComponent

    Introducing Radzen Blazor Studio

    Radzen Blazor Studio is a software development environment that empowers developers to design, build and deploy Blazor applications without the traditional hurdles. Write less code and get more done.

    Learn More

    Download Now
    Download Now
    In This Article
    Back to top Radzen Blazor Components, © 2018-2025 Radzen. Source Code licensed under MIT