Skip to main content
All docs
V24.2

DxDateEditSettings.NullValue Property

Specifies a null value for the date editor.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

Declaration

[Parameter]
public DateTime NullValue { get; set; }

Property Value

Type Description
DateTime

An object that specifies a null value.

Remarks

If a column is bound to the nullable type, use the NullValue property to override the column editor’s null value. Each time a user clears the editor’s content, the value is set to NullValue.

If a column is bound to the regular (non-nullable) type, specify the NullValue property to allow users to clear column editor content.

You can use the NullText property to specify the prompt text displayed when the editor is set to a null value.

<DxGrid Data="@employees" PageSize="6" EditMode="GridEditMode.EditRow">
    <Columns>
        <DxGridCommandColumn />
        <DxGridDataColumn FieldName="FirstName" />
        <DxGridDataColumn FieldName="LastName" />
        <DxGridDataColumn FieldName="HireDate" >
             <EditSettings>
                <DxDateEditSettings ClearButtonDisplayMode="DataEditorClearButtonDisplayMode.Auto" 
                    NullText="Select a date..." NullValue="@NullValue"/>
            </EditSettings>
        </DxGridDataColumn>
        <DxGridDataColumn FieldName="Email" />
    </Columns>
</DxGrid>

@code {
    Employee[]? employees;
    DateTime NullValue { get; set; } = new DateTime(2023, 01, 01);

    protected override async Task OnInitializedAsync() {
        employees = await EmployeeData.GetData();
    }
}

To specify the null value at runtime, use the IDateEditSettings.NullValue property instead.

Implements

See Also