Skip to main content
All docs
V22.1

DxTextBox.ClearButtonDisplayMode Property

Specifies whether the Text Box displays the Clear button when it is not empty.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v22.1.dll

NuGet Package: DevExpress.Blazor

Declaration

[Parameter]
public DataEditorClearButtonDisplayMode ClearButtonDisplayMode { get; set; }

Property Value

Type Description
DataEditorClearButtonDisplayMode

A DataEditorClearButtonDisplayMode enumeration value.

Available values:

Name Description
Auto

The clear button is visible when an editor is not empty.

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.

<DxTextBox @bind-Text="@TextValue" 
           ClearButtonDisplayMode="DataEditorClearButtonDisplayMode.Auto"></DxTextBox>

@code {
    string TextValue { get; set; } = "Some text";
}

TextBox Clear Button

Run Demo: Text Box - Clear Button and Placeholder

See Also