Back to Devexpress

DxInputDataEditorBase<T>.ClearButtonDisplayMode Property

blazor-devexpress-dot-blazor-dot-base-dot-dxinputdataeditorbase-1.md

latest2.5 KB
Original Source

DxInputDataEditorBase<T>.ClearButtonDisplayMode Property

Specifies whether an input editor displays the Clear button when it is not empty.

Namespace : DevExpress.Blazor.Base

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
[DefaultValue(DataEditorClearButtonDisplayMode.Never)]
[Parameter]
public DataEditorClearButtonDisplayMode ClearButtonDisplayMode { get; set; }

Property Value

TypeDefaultDescription
DataEditorClearButtonDisplayModeNever

A DataEditorClearButtonDisplayMode enumeration value.

|

Available values:

NameDescription
Auto

The clear button is visible when an editor is not empty. This mode requires that the editor’s data type is nullable.

| | Never |

The clear button is not visible.

|

Remarks

The Clear button clears the editor’s value (sets it to NULL). To display this button in the editor when there is a value in it, set the ClearButtonDisplayMode property to DataEditorClearButtonDisplayMode.Auto. This mode also requires that the editor’s data type is nullable.

razor
<DxMaskedInput @bind-Value="@Currency"
               T="double?"
               Mask="@NumericMask.Currency"
               ClearButtonDisplayMode="DataEditorClearButtonDisplayMode.Auto"
               BindValueMode="BindValueMode.OnInput"
               NullText="Type text..."
               CssClass="cw-320" />

@code {
    double? Currency { get; set; } = 123.45;
}

Run Demo: Masked Input - Clear Button and Placeholder

See Also

DxInputDataEditorBase<T> Class

DxInputDataEditorBase<T> Members

DevExpress.Blazor.Base Namespace