ASPxDateEdit.CalendarCustomDisabledDate Event
Allows you to disable days in the editor’s calendar.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v24.2.dll
NuGet Package: DevExpress.Web
#Declaration
public event EventHandler<CalendarCustomDisabledDateEventArgs> CalendarCustomDisabledDate
#Event Data
The CalendarCustomDisabledDate event's data class is CalendarCustomDisabledDateEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
Date | Gets the currently processed date. |
Is |
Specifies whether the processed date is disabled for selection. |
#Remarks
The editor raises the CalendarCustomDisabledDate event each time the editor needs to rerender a day cell.
Additionally, you can use the ASPxClientDateEdit.CalendarCustomDisabledDate event to disable dates on the client side. The ASPxDateEdit.DisabledDates property allows you to specify a collection of disabled dates in the calendar.
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 toAuto Post Back 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.
Tip
We recommend that you use the Calendar
#Example
protected void dateEdit_CalendarCustomDisabledDate(object sender, DevExpress.Web.CalendarCustomDisabledDateEventArgs e)
{
if (e.Date.DayOfWeek == DayOfWeek.Wednesday)
e.IsDisabled = true;
}
Result: