Back to Devexpress

EditBase.HasError Property

maui-devexpress-dot-maui-dot-editors-dot-editbase-1bd152fe.md

latest1.6 KB
Original Source

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

csharp
public bool HasError { get; set; }

Property Value

TypeDefaultDescription
Booleanfalse

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:

xml
<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"/>
csharp
private void Button_Pressed(object sender, EventArgs e){
    if (string.IsNullOrEmpty(Login.Text))
        Login.HasError = true;
    else
        Login.HasError = false;
}

See Also

EditBase Class

EditBase Members

DevExpress.Maui.Editors Namespace