EditBase.ErrorText Property

Specifies the text message that appears below the editor in an error state.

Namespace: DevExpress.XamarinForms.Editors

Assembly: DevExpress.XamarinForms.Editors.dll

Declaration

public string ErrorText { get; set; }

Property Value

Type Description
String

Error message.

Remarks

You can display the following text below an editor:

If HelpText is not set, ErrorText appears as an additional line below the edit box and page content shifts down. To prevent this behavior, set the ReserveBottomTextLine property to true.

Use the ErrorColor property to set the color of ErrorText, ErrorIcon, editor's label, and the edit box border.

The following properties allow you to customize the font settings, and the help/error text position:

Property

Description

BottomTextFontAttributes
BottomTextFontFamily
BottomTextFontSize

Configure the font settings for text displayed below the editor.

BottomTextTopIndent

Sets the distance between the editor's help or error text and its bottom border.

Examples

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

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

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