Back to Devexpress

DxDateEdit<T>.DateChanged Event

blazor-devexpress-dot-blazor-dot-dxdateedit-1-fab6830e.md

latest1.7 KB
Original Source

DxDateEdit<T>.DateChanged Event

Fires after a user changed a date in the Date Edit.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
[Parameter]
public EventCallback<T> DateChanged { get; set; }

Parameters

TypeDescription
T

A delegate method that accepts the date value as a parameter.

|

Remarks

The DateChanged event allows you to handle changes to the selected date. The following code snippet enables the Update Date button once the Date Edit value is changed.

razor
<DxDateEdit Date="@Date"
            DateChanged="@((DateTime newValue) => OnDateChanged(newValue))" />

<button type="button" class="btn btn-primary" disabled="@IsDisabled">Update Date</button>

@code {
    DateTime Date = DateTime.Today;
    bool IsDisabled = true;

    void OnDateChanged(DateTime newValue) {
        Date = newValue;
        if (newValue != DateTime.Today)
            IsDisabled = false;
        else IsDisabled = true;
    }
}

View Example: Grid for Blazor - Implement a date range filter

You can also use the DateChanging event to validate/cancel the newly selected date.

See Also

DxDateEdit<T> Class

DxDateEdit<T> Members

DevExpress.Blazor Namespace