Skip to main content

DxTimeEdit<T>.TimeChanged Event

Fires after a user changes time in the Time Edit.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

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

Parameters

Type Description
T

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

Remarks

The TimeChanged event allows you to handle changes to selected time. The following code snippet enables the Update Time button once the Time Edit component’s value is changed.

<DxTimeEdit Time="@Time" 
            TimeChanged="@((TimeSpan newValue) => OnTimeChanged(newValue))">
</DxTimeEdit>

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

@code {
    TimeSpan Time = DateTime.Now.TimeOfDay;
    bool IsDisabled = true;

    void OnTimeChanged(TimeSpan newValue) {
        Time = newValue;
        if (newValue != DateTime.Now.TimeOfDay)
            IsDisabled = false;
        else IsDisabled = true;
    }
}
See Also