Skip to main content

DxDateEditSettings.DisabledDateNotificationText Property

The notification message displayed in scroll picker mode when a user selects a date disabled by the CustomDisabledDate event.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

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

Property Value

Type Default Description
String null

Notification text.

Remarks

You can handle the CustomDisabledDate event to disable specific dates in the date editor’s calendar. Disabled dates are grayed out.

In scroll picker mode, the editor shows a notification message each time a user tries to navigate to a disabled date. The default notification text is “The selected date is unavailable. Please choose a different date.“.

To customize the notification text, use the DisabledDateNotificationText property. The following code snippet disables Saturdays, Sundays, and a set of custom holidays in the date editor.

<DxGrid Data="@employees" EditMode="GridEditMode.EditRow">
    <Columns>
        <DxGridCommandColumn />
        <DxGridDataColumn FieldName="FirstName" />
        <DxGridDataColumn FieldName="LastName" />
        <DxGridDataColumn FieldName="HireDate" >
             <EditSettings>
                <DxDateEditSettings CustomDisabledDate="@OnCustomDisabledDate" 
                    PickerDisplayMode="DatePickerDisplayMode.ScrollPicker" 
                    DisabledDateNotificationText="The hire date cannot be a holiday or weekend. Please select a working day." />
            </EditSettings>
        </DxGridDataColumn>
        <DxGridDataColumn FieldName="Email" />
    </Columns>
</DxGrid>

@code {
    Employee[]? employees;
    protected override async Task OnInitializedAsync() {
        employees = await EmployeeData.GetData();
    }
    void OnCustomDisabledDate(CalendarCustomDisabledDateEventArgs args) {
        args.IsDisabled = args.Date.DayOfWeek == DayOfWeek.Saturday
            || args.Date.DayOfWeek == DayOfWeek.Sunday 
            || GetHolidays().Exists(d => d.Date == args.Date.Date);
    }
    List<DateTime> GetHolidays() {
        return new List<DateTime>() { 
            new DateTime(2023, 05, 01),
            new DateTime(2023, 05, 02),
            new DateTime(2023, 05, 15),
            new DateTime(2023, 05, 23)
        };
    }
}

Date Editor Disabled Date Notification

To specify the notification text at runtime, use the IDateEditSettings.DisabledDateNotificationText property instead.

See Also