Back to Devexpress

EditBase.ErrorText Property

maui-devexpress-dot-maui-dot-editors-dot-editbase-a74f86d8.md

latest3.3 KB
Original Source

EditBase.ErrorText Property

Gets or sets the text message that appears below the editor in an error state. This is a bindable property.

Namespace : DevExpress.Maui.Editors

Assembly : DevExpress.Maui.Editors.dll

NuGet Package : DevExpress.Maui.Editors

Declaration

csharp
public string ErrorText { get; set; }

Property Value

TypeDescription
String

The error message.

|

Remarks

You can display the following text below an editor:

  • HelpText - A brief editor description.
  • ErrorText - A message shown when an error occurs (HasError is true).

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, the editor’s label, and the edit box border. You can also use the ErrorIconColor property to specify an individual color for the error icon.

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.

|

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