Skip to main content

DateEditSettings.CalendarCustomDisabledDate Property

Enables you to disable days in the calendar.

Namespace: DevExpress.Web.Mvc

Assembly: DevExpress.Web.Mvc5.v23.2.dll

NuGet Package: DevExpress.Web.Mvc5

Declaration

public EventHandler<CalendarCustomDisabledDateEventArgs> CalendarCustomDisabledDate { get; set; }

Property Value

Type Description
EventHandler<CalendarCustomDisabledDateEventArgs>

A EventHandler<TEventArgs><CalendarCustomDisabledDateEventArgs,> delegate method allowing you to implement custom processing.

Remarks

The CalendarCustomDisabledDate fires each time the control is going to re-render a day cell.

Note

MVC Specifics:

To use the CalendarCustomDisabledDate event, place the DateEdit in a separate view and specify the CallbackRouteValues property.

Additionally, you can use the ASPxClientDateEdit.CalendarCustomDisabledDate event to disable dates on the client side.

Note

The CustomDisabledDate event handlers affect the manner in which the calendar is updated (navigates to another month/year).

  • When only the client-side ASPxClientDateEdit.CalendarCustomDisabledDate event is handled, the calendar operates on the client side.
  • When only the server-side CalendarCustomDisabledDate event is handled, the manner in which the calendar is updated depends upon the ASPxEdit.AutoPostBack property setting. If the ASPxEdit.AutoPostBack property is set to true, the calendar initiates a postback to the server; otherwise, it’s updated using callback technology.
  • When both events are handled, the calendar operates on the client side. However, for the calendar to work properly, you should provide equivalent logic in both the client and server-side event handlers.

Example

settings.CalendarCustomDisabledDate = (sender, e) => {  
    if (e.Date.DayOfWeek == DayOfWeek.Wednesday)
        e.IsDisabled = true;
};  

Result:

Calendar Custom Disabled Date

See Also