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

DxTimeEditSettings.MaxTime Property

Specifies the maximum time value that can be selected in the time editor.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[Parameter]
public TimeSpan MaxTime { get; set; }

#Property Value

Type Description
TimeSpan

A TimeSpan value in the range from 0 to a day that specifies maximum time.

#Remarks

Use the MinTime and MaxTime properties to specify a range of available time values.

The time editor shows a notification message each time a user tries to navigate to a time value outside the range. The default notification text is “The selected time value should be between {MinTime} and {MaxTime}“. To customize the notification text, use the OutOfRangeNotificationText property.

<DxGrid Data="@timetable" EditMode="GridEditMode.EditRow">
    <Columns>
        <DxGridCommandColumn />
        <DxGridDataColumn FieldName="ID" Visible="false" />
        <DxGridDataColumn FieldName="Nickname" />
        <DxGridDataColumn FieldName="StartTime">
            <EditSettings>
                <DxTimeEditSettings Format="h:mm"
                                    DisplayFormat="t" 
                                    MinTime="@MinTime" 
                                    MaxTime="@MaxStartTime" 
                                    OutOfRangeNotificationText="Game time can start from 9 am to 8 pm."
                                    ScrollPickerFormat="tt hh mm" />
            </EditSettings>
        </DxGridDataColumn>
        <DxGridDataColumn FieldName="EndTime" >
            <EditSettings>
                <DxTimeEditSettings Format="h:mm"
                                    DisplayFormat="t" 
                                    MinTime="@MinTime" 
                                    MaxTime="@MaxEndTime"
                                    OutOfRangeNotificationText="Game time can end from 9 am to 9 pm."
                                    ScrollPickerFormat="tt hh mm" />
            </EditSettings>
        </DxGridDataColumn>
    </Columns>
</DxGrid>

@code {
    Result[]? timetable;
    TimeSpan MinTime = new TimeSpan(09, 0, 0);
    TimeSpan MaxStartTime = new TimeSpan(20, 0, 0);
    TimeSpan MaxEndTime = new TimeSpan(21, 0, 0);

    protected override async Task OnInitializedAsync() {
        timetable = await TimeTable.GetData();
    }
}

Grid - Time Editor

To change the maximum time value at runtime, use the ITimeEditSettings.MaxTime property instead.

#Implements

See Also