Skip to main content

DxDateEditSettings.OutOfRangeNotificationText Property

Specifies the notification message displayed in the scroll picker mode when a user selects a date outside the permitted date range.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

[DefaultValue(null)]
[Parameter]
public string OutOfRangeNotificationText { get; set; }

Property Value

Type Default Description
String null

A notification text.

Remarks

The date editor implements the MinDate and MaxDate properties that specify a range of available dates. In scroll picker mode, the editor shows a notification message each time a user tries to navigate to a date that is outside the range. The default notification text is “The selected date should be between {MinDate} and {MaxDate}“.

To customize notification texts, use the OutOfRangeNotificationText property.

<DxGrid Data="@employees" EditMode="GridEditMode.EditRow">
    <Columns>
        <DxGridCommandColumn />
        <DxGridDataColumn FieldName="FirstName" />
        <DxGridDataColumn FieldName="LastName" />
        <DxGridDataColumn FieldName="HireDate" >
             <EditSettings>
                <DxDateEditSettings MinDate="@minDate" MaxDate="@maxDate"
                    PickerDisplayMode="DatePickerDisplayMode.ScrollPicker"
                    OutOfRangeNotificationText="@currentMonthNotification"/>
            </EditSettings>
        </DxGridDataColumn>
        <DxGridDataColumn FieldName="Email" />
    </Columns>
</DxGrid>

@code {
    Employee[]? employees;
    // set minDate to the first day of the current month.
    DateTime minDate = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1);
    // set maxDate to the last day of the current month.
    DateTime maxDate = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1).AddMonths(1).AddDays(-1);
    string currentMonthNotification = "Please select a date in the current month (" + 
                                       DateTime.Today.ToString("MMM", CultureInfo.InvariantCulture) + ").";
    protected override async Task OnInitializedAsync() {
        employees = await EmployeeData.GetData();
    }
}

Date Editor Out of Range Dates Notification

To specify the out-of-range notification text at runtime, use the IDateEditSettings.OutOfRangeNotificationText property instead.

See Also