Skip to main content
All docs
V24.1

DxHtmlEditorVariables.Data Property

Specifies an array of variables.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

[Parameter]
public IEnumerable<string> Data { get; set; }

Property Value

Type Description
IEnumerable<String>

An array of variables.

Remarks

Add a DxHtmlEditorVariables object to component markup and use the Data property to store variables.

Example

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

Html Editor - Variables

@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