Back to Devexpress

DxTimeEdit<T>.TimeChanged Event

blazor-devexpress-dot-blazor-dot-dxtimeedit-1-d4ded775.md

latest1.4 KB
Original Source

DxTimeEdit<T>.TimeChanged Event

Fires after a user changes time in the Time Edit.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

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

Parameters

TypeDescription
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.

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

DxTimeEdit<T> Class

DxTimeEdit<T> Members

DevExpress.Blazor Namespace