GlobalOptions.ShowValidationSuccessState Property
Specifies whether Blazor editors indicate the validation success status. When an input value is valid, it becomes marked with green outlines and can show a success icon.
Namespace: DevExpress.Blazor.Configuration
Assembly: DevExpress.Blazor.v24.2.dll
NuGet Package: DevExpress.Blazor
Declaration
public bool ShowValidationSuccessState { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
|
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, but does not indicate the success status for valid inputs. You can use the ShowValidationSuccessState
global option to specify whether Blazor editors should indicate the validation success status: become marked with green outlines and shows a success icon .
Note
- When
ShowValidationSuccessState
istrue
andShowValidationIcon
isfalse
, only green outlines indicate the success status. - For editors displayed in DxGrid cells and DxTreeList cells, only validation icons can be displayed, green or red outlines are not displayed.
You can specify the ShowValidationSuccessState
global option in a few different ways:
Call the AddDevExpressBlazor(IServiceCollection, Action<GlobalOptions>) method.
using DevExpress.Blazor; builder.Services.AddDevExpressBlazor(configure => configure.ShowValidationSuccessState = 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.ShowValidationSuccessState = true);
Define the global option’s value in the
appsettings.json
file.{ "DevExpress": { "ShowValidationSuccessState": "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));
You can also specify the ShowValidationSuccessState
property individually data editors and auto-generated editors in Grid and TreeList.