GlobalOptions.ShowValidationIcon Property
Specifies whether Blazor editors show validation icons. Affects only standalone editors.
Namespace: DevExpress.Blazor.Configuration
Assembly: DevExpress.Blazor.v25.1.dll
NuGet Package: DevExpress.Blazor
Declaration
[DefaultValue(true)]
public bool ShowValidationIcon { get; set; }
Property Value
| Type | Default | Description |
|---|---|---|
| Boolean | true |
|
Remarks
DevExpress input editors support data validation. You can add editors to the Blazor’s standard EditForm. This form validates user input based on data annotation attributes defined in a model.
Data editors can display validation icons and colored outlines based on validation results. Editors with default settings display red outlines and error icons
when validation fails. However, you can use the following properties to change how editors display their validation status:
The
ShowValidationIconglobal property - Specifies whether Blazor editors should show validation icons - error
or success
. The ShowValidationSuccessState global property - Specifies whether Blazor editors should indicate the validation success status: become marked with green outlines and shows a success icon
.
Note
- The
ShowValidationIconoption affects only standalone editors. It does not affect auto-generated editors displayed in DxGrid and DxTreeList rows/cells. - When
ShowValidationSuccessStateistrueandShowValidationIconisfalse, only green outlines indicate the success status. - You can also specify ShowValidationSuccessState and ShowValidationIcon properties for each editor individually.
You can specify the ShowValidationIcon global option in a few different ways:
Call the AddDevExpressBlazor(IServiceCollection, Action<GlobalOptions>) method.
using DevExpress.Blazor; builder.Services.AddDevExpressBlazor(configure => configure.ShowValidationIcon = true);Call the services.Configure method that registers a configuration instance with the specified global option’s value.
using DevExpress.Blazor; using DevExpress.Blazor.Configuration; builder.Services.Configure<GlobalOptions>((options) => options.ShowValidationIcon = true);Define the global option’s value in the
appsettings.jsonfile.{ "DevExpress": { "ShowValidationIcon": "true" } }Call the services.Configure method. Use the ConfigurationBinder.Bind method to register a configuration instance with the specified global option’s value.
using DevExpress.Blazor; using DevExpress.Blazor.Configuration; builder.Services.Configure<GlobalOptions>(options => builder.Configuration.Bind("DevExpress", options));