Back to Devexpress

DataEditorClearButtonDisplayMode Enum

blazor-devexpress-dot-blazor-49bed5cc.md

latest2.6 KB
Original Source

DataEditorClearButtonDisplayMode Enum

Lists values that specify when the clear button is visible.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
public enum DataEditorClearButtonDisplayMode

Members

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.

|

The following properties accept/return DataEditorClearButtonDisplayMode values:

Remarks

The Clear button allows users to clear (set to null) an editor value. The button can be displayed when the editor is not in the read-only state. Use an editor’s ClearButtonDisplayMode property to specify the clear button’s visibility.

The following code snippet displays the clear button in the DxComboBox<TData, TValue>.

razor
<DxComboBox Data="@Cities" 
            ClearButtonDisplayMode="DataEditorClearButtonDisplayMode.Auto"
            NullText="Select City..."
            @bind-Value="@Value"/>

@code {
    string Value { get; set; }
    IEnumerable<string> Cities = new List<string>() { "London", "Berlin", "Paris", };
}

Run Demo: ComboBox - Clear Button and Placeholder

See Also

DevExpress.Blazor Namespace