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.Data Property

Specifies an array of variables.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[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:

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