Skip to main content
All docs
V25.1
  • DevExpress v25.1 Update — Your Feedback Matters

    Our What's New in v25.1 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

    Take the survey Not interested

    DxInputDataEditorBase<T>.ShowValidationIcon Property

    Specifies whether an editor shows validation icons.

    Namespace: DevExpress.Blazor.Base

    Assembly: DevExpress.Blazor.v25.1.dll

    NuGet Package: DevExpress.Blazor

    #Declaration

    C#
    [Parameter]
    public bool? ShowValidationIcon { get; set; }

    #Property Value

    Type Description
    Nullable<Boolean>

    null to inherit the value from the GlobalOptions.ShowValidationIcon property; true to display a validation icon; otherwise, false.

    #Remarks

    DevExpress input editors support data validation. You can add editors to Blazor’s standard EditForm. This form validates user input based on data annotation attributes defined in a model. When a user enters invalid data into an editor, the editor gets a red outline. You can also use the ShowValidationIcon global option or the editor’s ShowValidationIcon property to specify whether the editor should display validation icons - error Error or success Success.

    Razor
    @using System.ComponentModel.DataAnnotations*
    
    <EditForm Model="@starship"
              OnValidSubmit="@HandleValidSubmit"
              OnInvalidSubmit="@HandleInvalidSubmit"
              Context="EditFormContext">
        <DataAnnotationsValidator/>
        <DxFormLayout>
            <DxFormLayoutItem Caption="Identifier:" ColSpanMd="6">
                <DxTextBox @bind-Text="@starship.Identifier" 
                           ShowValidationIcon="true"/>
            </DxFormLayoutItem>
            <DxFormLayoutItem Caption="Primary Classification:" ColSpanMd="6">
                <DxComboBox NullText="Select classification ..."
                            ClearButtonDisplayMode="DataEditorClearButtonDisplayMode.Auto"
                            Data="classifications"
                            @bind-Value="@starship.Classification"
                            ShowValidationIcon="true"/>
            </DxFormLayoutItem>
            ...
          </DxFormLayout>
    </EditForm>
    

    Show Validation Icon

    Run Demo: Form Validation - Form Layout

    Run Demo: Form Validation - Custom Form

    See Also