DateEditSettings.CalendarCustomDisabledDate Property
Enables you to disable days in the calendar.
Namespace: DevExpress.Web.Mvc
Assembly: DevExpress.Web.Mvc5.v24.2.dll
NuGet Package: DevExpress.Web.Mvc5
#Declaration
public EventHandler<CalendarCustomDisabledDateEventArgs> CalendarCustomDisabledDate { get; set; }
#Property Value
Type | Description |
---|---|
Event |
A Event |
#Remarks
The CalendarCustomDisabledDate fires each time the control is going to re-render a day cell.
Note
MVC Specifics:
To use the Calendar
Additionally, you can use the ASPxClientDateEdit.CalendarCustomDisabledDate event to disable dates on the client side.
Note
The Custom
- When only the client-side ASPx
Client event is handled, the calendar operates on the client side.Date Edit. Calendar Custom Disabled Date - When only the server-side Calendar
Custom event is handled, the manner in which the calendar is updated depends upon the ASPxDisabled Date Edit. property setting. If the ASPxAuto Post Back Edit. property is set to true, the calendar initiates a postback to the server; otherwise, it’s updated using callback technology.Auto Post Back - 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: