Back to Devexpress

DxHtmlEditorVariables.EscapeCharacters Property

blazor-devexpress-dot-blazor-dot-dxhtmleditorvariables-b2592537.md

latest2.3 KB
Original Source

DxHtmlEditorVariables.EscapeCharacters Property

Specifies escape sequences that enclose placeholder variables in the document.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
[Parameter]
public object EscapeCharacters { get; set; }

Property Value

TypeDescription
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

DxHtmlEditorVariables Class

DxHtmlEditorVariables Members

DevExpress.Blazor Namespace