menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class RichTextEditorFormatPainterSettings - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class RichTextEditorFormatPainterSettings

    Represents configuration settings for the Format Painter feature in a rich text editor.

    Inheritance
    System.Object
    RichTextEditorFormatPainterSettings
    Namespace: Syncfusion.Blazor.RichTextEditor
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class RichTextEditorFormatPainterSettings : OwningComponentBase
    Remarks

    This class defines the allowed and denied format selectors for copying and applying styles using the Format Painter tool.

    Use this class within the SfRichTextEditor component to customize Format Painter behavior.

    The settings can be overridden at runtime using the FormatPainterParams.Options parameter in the ExecuteCommandAsync method.

    Examples

    This example demonstrates how to configure the RichTextEditorFormatPainterSettings for a Format Painter in a SfRichTextEditor component.

     
    
    @using Syncfusion.Blazor.RichTextEditor; 
    <SfRichTextEditor> 
        <RichTextEditorToolbarSettings Items="@Tools" /> 
        <RichTextEditorFormatPainterSettings AllowedFormats="b; em; strong; span" DeniedFormats="img; a" /> 
    </SfRichTextEditor> 
    @code { 
        private List<ToolbarItemModel> Tools = new List<ToolbarItemModel> 
        { 
            new ToolbarItemModel { Command = ToolbarCommand.FormatPainter } 
        }; 
    } 

    Constructors

    RichTextEditorFormatPainterSettings()

    Declaration
    public RichTextEditorFormatPainterSettings()

    Properties

    AllowedFormats

    Specifies the element selectors from which formats can be copied.

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

    A string of allowed format selectors, defaulting to a comprehensive list of HTML tags and attributes.

    Remarks

    This parameter defines the default allowed formats for the Format Painter. It can be overridden by the AllowedFormats property in FormatPainterParams.Options during command execution in ExecuteCommandAsync method.

    Examples
     
    
    @using Syncfusion.Blazor.RichTextEditor; 
    <SfRichTextEditor> 
        <RichTextEditorToolbarSettings Items="@Tools" /> 
        <RichTextEditorFormatPainterSettings AllowedFormats="b; em; strong; span" /> 
    </SfRichTextEditor> 
    @code { 
        private List<ToolbarItemModel> Tools = new List<ToolbarItemModel> 
        { 
            new ToolbarItemModel { Command = ToolbarCommand.FormatPainter } 
        }; 
    } 

    DeniedFormats

    Specifies the element selectors from which formats cannot be copied.

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

    A string of denied format selectors, defaulting to null (no restrictions).

    Remarks

    This parameter sets the default denied formats for the Format Painter. It can be overridden by the DeniedFormats property in FormatPainterParams.Options when executing a command.

    Examples
     
    
    @using Syncfusion.Blazor.RichTextEditor; 
    <SfRichTextEditor> 
        <RichTextEditorToolbarSettings Items="@Tools" /> 
        <RichTextEditorFormatPainterSettings DeniedFormats="img; a" /> 
    </SfRichTextEditor> 
    @code { 
        private List<ToolbarItemModel> Tools = new List<ToolbarItemModel> 
        { 
            new ToolbarItemModel { Command = ToolbarCommand.FormatPainter } 
        }; 
    } 

    Methods

    Dispose(Boolean)

    Dispose unmanaged resources in the Syncfusion Blazor component.

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing

    Boolean value to dispose the object.

    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.

    OnParametersSetAsync()

    Method invoked when the component has received parameters from its parent.

    Declaration
    protected override Task OnParametersSetAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task

    A System.Threading.Tasks.Task representing any asynchronous operation.

    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved