Skip to main content

EditBase.HasError Property

Gets or sets whether the editor has an error. This is a bindable property.

Namespace: DevExpress.Maui.Editors

Assembly: DevExpress.Maui.Editors.dll

NuGet Package: DevExpress.Maui.Editors

Declaration

public bool HasError { get; set; }

Property Value

Type Default Description
Boolean false

true to enable the error state; otherwise, false.

Example

This example shows how to validate the text input and customize the appearance of an error message:

TextEdit - Validation

<dxe:TextEdit x:Name="Login"
              BottomTextFontAttributes="Italic"
              BottomTextFontSize="14"
              BottomTextTopIndent="8"
              ErrorColor="Brown"
              ErrorText="Login cannot be empty"
              ReserveBottomTextLine="True"/>

<dx:DXButton Content="Submit"
                  Pressed="Button_Pressed"/>
private void Button_Pressed(object sender, EventArgs e){
    if (string.IsNullOrEmpty(Login.Text))
        Login.HasError = true;
    else
        Login.HasError = false;
}
See Also