Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DxTimeEdit<T>.Time Property

Specifies time that is selected in the Time Edit component.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[Parameter]
public T Time { get; set; }

#Property Value

Type Description
T

A value that defines selected time.

#Remarks

Use the Time property to specify the Time Edit’s selected time…

Razor
<DxTimeEdit Time="new TimeSpan(9, 30, 0);"></DxTimeEdit>

… or bind the property to a variable that stores time.

Razor
<DxTimeEdit @bind-Time="@TimeValue" ></DxTimeEdit>

@code {
    TimeSpan TimeValue { get; set; } = DateTime.Now.TimeOfDay;
}

The Time Edit supports DateTime, Nullable DateTime, TimeSpan, and Nullable TimeSpan types.

You can use the MinTime and MaxTime properties to specify a range of available time values. The Time Edit’s time picker disables times outside the range.

Note

  • If a user types a value outside the range, the Time Edit keeps the previously selected time.
  • The Time Edit shows a notification message each time a user tries to navigate to a time value that is out of the range. To customize the notification text, use the OutOfRangeNotificationText property.
  • You can set the Time property to a time outside the range. In this case, the Time Edit shows this specified time, and the Time Edit’s picker displays the closest available time.

To handle the time change, use the TimeChanged event.

Run Demo: Time Edit

See Also