Back to Devexpress

DxHtmlEditor.ShowValidationMessageOnFocus Property

blazor-devexpress-dot-blazor-dot-dxhtmleditor-eb440bba.md

latest2.0 KB
Original Source

DxHtmlEditor.ShowValidationMessageOnFocus Property

Specifies whether the editor hides a validation message after the editor’s focus is lost.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
[DefaultValue(true)]
[Parameter]
public bool ShowValidationMessageOnFocus { get; set; }

Property Value

TypeDefaultDescription
Booleantrue

true to hide a validation message after the editor loses focus; otherwise, false.

|

Remarks

<DxHtmlEditor> allows you to validate user input. To specify validation rules, use the IsValid property.

When a user enters an invalid value, the focused editor displays a validation message at the specified position. After the editor loses focus, it hides the validation message. Disable the ShowValidationMessageOnFocus property to change this behavior.

razor
<DxHtmlEditor Markup="@markup"
              IsValid="@isValid"
              ValidationMessage="Empty markup."
              ShowValidationMessageOnFocus="false"
              ValidationMessagePosition="HtmlEditorValidationMessagePosition.Right"
              MarkupChanged="@OnMarkupChanged"
              Height="100px"
              Width="80%" />

@code {
    bool isValid;
    string markup { get; set; } = "";
    void OnMarkupChanged(string newValue) {
        markup = newValue;
        isValid = !string.IsNullOrEmpty(newValue);
    }
}

See Also

DxHtmlEditor Class

DxHtmlEditor Members

DevExpress.Blazor Namespace