Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 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

DxDropDownListEditorBase<TData, TValue>.ClearButtonDisplayMode Property

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

Namespace: DevExpress.Blazor.Base

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

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

#Property Value

Type Default Description
DataEditorClearButtonDisplayMode Never

A DataEditorClearButtonDisplayMode enumeration value.

Available values:

Name Description
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 a non-empty editor, set the ClearButtonDisplayMode property to DataEditorClearButtonDisplayMode.Auto. This mode also requires that the editor’s data type is nullable.

#ComboBox Example

<DxComboBox NullText="Select a country..."
            Data="@CountryData.Countries"
            @bind-Value="@CurrentCountry"
            TextFieldName="@nameof(Country.CountryName)"
            ClearButtonDisplayMode="DataEditorClearButtonDisplayMode.Auto">
</DxComboBox>

@code {
    Country CurrentCountry { get; set; } = CountryData.Countries[1];
}

Run Demo: ComboBox - Clear Button and Placeholder

Watch Video: ComboBox Getting Started – Clear Button

#TagBox Example

The following code snippet adds the Clear button to the TagBox. When users clear the editor’s value, the TagBox displays the NullText string (if specified).

<DxTagBox NullText="Select countries..."
          Data="@CountryData.Countries"
          @bind-Values="@SelectedCountries"
          TextFieldName="@nameof(Country.CountryName)"
          ClearButtonDisplayMode="DataEditorClearButtonDisplayMode.Auto">
</DxTagBox>

@code {
    IEnumerable<Country> SelectedCountries { get; set; }
}

Run Demo: TagBox - Clear Button and Placeholder

#Implements

DevExpress.Blazor.IDropDownListEditorBase<TData, TValue>.ClearButtonDisplayMode
See Also