Skip to main content
All docs
V24.2

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

DxHtmlEditorVariables.EscapeCharacters Property

Specifies escape sequences that enclose placeholder variables in the document.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[Parameter]
public object EscapeCharacters { get; set; }

#Property Value

Type Description
Object

The escape characters.

#Remarks

<DxHtmlEditor> supports placeholder variables you can use to create templates for document generation. When a user clicks the toolbar’s Variable command, the component displays a drop-down list of available variables. The editor inserts the selected placeholder variable at the caret position in the document and encloses the variable between escape sequences. The default escape sequences are { and }.

Specify the EscapeCharacters property if you need to change escape sequences. This property accepts one string value or an array of strings.

#Example

The following code snippet implements placeholder variables and adds the Variable command to the built-it toolbar:

Razor
@using DevExpress.Blazor.Office

<DxHtmlEditor Height="200px"
              CustomizeToolbar="@OnCustomizeToolbar">
    <DxHtmlEditorVariables Data=@Variables
                           EscapeCharacters="@escapeChar" />
</DxHtmlEditor>

@code {
    string[] Variables = new string[] { "FirstName", "LastName" };
    // Declare one string
    string escapeChar = "$";
    // Declare an array of strings
    string[] escapeChar = new string[] { "$", "$" };

    void OnCustomizeToolbar(IToolbar toolbar) {
        toolbar.Groups.Add(HtmlEditorToolbarGroupNames.Variable);
    }
}
See Also