DxDataGridColumn.ClearButtonDisplayMode Property

Specifies whether the Clear button is displayed in a non-empty editor that corresponds to a column in the Edit Form.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v21.1.dll

Declaration

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

Property Value

Type Default Description
DataEditorClearButtonDisplayMode

DataEditorClearButtonDisplayMode.Never

A DataEditorClearButtonDisplayMode enumeration value.

Available values:

Name Description
Auto

The Clear button is displayed when an editor is not empty and is not in the read-only state. This mode requires that the editor’s data type is nullable.

Never

The Clear button is not displayed.

Remarks

Set the column’s ClearButtonDisplayMode property to DataEditorClearButtonDisplayMode.Auto to display the Clear button in a non-empty editor that corresponds to the column in the Edit Form. This mode also requires that the column is bound to an object of a nullable type.

Note

The non-empty editors shown in the Filter Row display the Clear button regardless of the ClearButtonDisplayMode property value.

The code below adds the Clear button to the editors displayed in the Edit Form for the following columns:

  • Date
  • Forecast
  • Cloud Cover
<DxDataGrid Data="@forecasts">
    <DxDataGridCommandColumn ClearFilterButtonVisible="false"/>
    <DxDataGridDateEditColumn Field="@nameof(WeatherForecast.Date)" DisplayFormat="D" EditorFormat="D" 
        ClearButtonDisplayMode="DataEditorClearButtonDisplayMode.Auto"/>
    <DxDataGridColumn Field="@nameof(WeatherForecast.Forecast)" 
        ClearButtonDisplayMode="DataEditorClearButtonDisplayMode.Auto"/>
    <DxDataGridSpinEditColumn Field="@nameof(WeatherForecast.TemperatureC)" Caption="@("Temp. (\x2103)")"/>
    <DxDataGridComboBoxColumn Field="@nameof(WeatherForecast.CloudCover)" 
        DataAsync="@ForecastService.GetCloudCoverAsync" 
        ClearButtonDisplayMode="DataEditorClearButtonDisplayMode.Auto"/>
    <DxDataGridCheckBoxColumn Field="@nameof(WeatherForecast.Precipitation)" />
</DxDataGrid>

DataGrid Column Clear Button Display Mode

See Also