Back to Devexpress

DxTextEditSettings.ClearButtonDisplayMode Property

blazor-devexpress-dot-blazor-dot-dxtexteditsettings.md

latest2.9 KB
Original Source

DxTextEditSettings.ClearButtonDisplayMode Property

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

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

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

Property Value

TypeDefaultDescription
DataEditorClearButtonDisplayModeNever

An enumeration value.

|

Available values:

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.

|

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.

razor
<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>

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

Implements

ClearButtonDisplayMode

See Also

DxTextEditSettings Class

DxTextEditSettings Members

DevExpress.Blazor Namespace