We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Using Rich Text Editor with In-place Editor

Is there a way to get the HTML generated by the Rich Text editor to display as HTML? The In-place Editor allows me to edit with the editor, but I have to bind this to a regular string, which shows all of the HTML. Is there a way I could get this to bind to a MarkupString instead?




1 Reply

VJ Vinitha Jeyakumar Syncfusion Team October 19, 2022 09:19 AM UTC

Hi Lucas,


Your requirement to get the HTML strings can be achieved by getting the value of the Rich Text Editor using instance object just like below,

Code snippet:
<SfInPlaceEditor Type="Syncfusion.Blazor.InPlaceEditor.InputType.RichTextEditor" @bind-Value="@value" TValue="string">
                <EditorComponent>
                    <SfRichTextEditor @ref="rteObj" @bind-Value="@value">
                    </SfRichTextEditor>
                </EditorComponent>
            </SfInPlaceEditor>
            <SfButton OnClick="Click">getHTML</SfButton>
            <div>
                @Content
            </div>
@code {
    SfRichTextEditor rteObj;
    private string value { get; set; } = "syncfusion";
    public string Content {get;set;}
    public void Click()
    {
       Content =  rteObj.Value;

    }
}


Regards,
Vinitha

Loader.
Live Chat Icon For mobile
Up arrow icon