Skip to main content
All docs
V25.1
  • DxTextEditSettings.ClearButtonDisplayMode Property

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

    Namespace: DevExpress.Blazor

    Assembly: DevExpress.Blazor.v25.1.dll

    NuGet Package: DevExpress.Blazor

    Declaration

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

    Property Value

    Type Default Description
    DataEditorClearButtonDisplayMode Never

    An 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 allows users to clear the editor’s value (sets it to null). Set the ClearButtonDisplayMode property to Auto to display the Clear button in a non-empty editor. This mode also requires that the editor’s data type is nullable.

    Note that the ClearButtonDisplayMode property does not affect the editor displayed in the filter row whose Clear button is always in Auto mode. You can handle the CustomizeFilterRowEditor event to customize filter row editor settings.

    <DxGrid Data="@products" PageSize="4"
            EditMode="GridEditMode.EditRow">
        <Columns>
            <DxGridCommandColumn />
            <DxGridDataColumn FieldName="ProductID" DisplayFormat="00000" />
            <DxGridDataColumn FieldName="ProductName" >
                <EditSettings>
                    <DxTextBoxSettings ClearButtonDisplayMode="DataEditorClearButtonDisplayMode.Auto" />
                </EditSettings>
            </DxGridDataColumn>
            <DxGridDataColumn FieldName="UnitPrice" DisplayFormat="c" />
            <DxGridDataColumn FieldName="UnitsInOrder" />  
        </Columns>
    </DxGrid>
    

    Editor Clear Button

    To change the Clear button display mode at runtime, use the ITextEditSettings.ClearButtonDisplayMode property.

    See Also