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

DxDateEdit<T>.TimeSectionVisible Property

Specifies whether the Date Edit displays a time section.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[Parameter]
public bool TimeSectionVisible { get; set; }

#Property Value

Type Description
Boolean

true to display the time section; otherwise, false.

#Remarks

You can enable time input in a Date Edit. If enabled, the editor displays the Time tab in the dropdown and a time input section in the edit box.

To add the time section to the component, set the TimeSectionVisible property to true.

Razor
<DxDateEdit @bind-Date="@DateTimeValue"
            TimeSectionVisible="true"></DxDateEdit>

@code {
    DateTime DateTimeValue { get; set; } = DateTime.Now;
}

Date Edit - Time Section

The section’s appearance depends on the current culture. If the culture does not use a 12-hour time format, time values are in 24-hour format and the section’s AM/PM column is not displayed.

If you add a time section to the Date Edit, you can also use the DisplayFormat and Format properties to format the time value in display and edit modes, respectively.

The following example applies the full date long time format in display mode and the full date short time format in edit mode:

Razor
<DxDateEdit @bind-Date="@DateTimeValue" 
            TimeSectionVisible="true" 
            DisplayFormat="F" 
            Format="f">
</DxDateEdit>

@code {
    DateTime DateTimeValue { get; set; } = DateTime.Now;
}

Run Demo: Date Edit - Time Section

See Also