aspnet-devexpress-dot-web-dot-aspxdateedit-dec9d2cc.md
Allows you to disable days in the editor’s calendar.
Namespace : DevExpress.Web
Assembly : DevExpress.Web.v25.2.dll
NuGet Package : DevExpress.Web
public event EventHandler<CalendarCustomDisabledDateEventArgs> CalendarCustomDisabledDate
Public Event CalendarCustomDisabledDate As EventHandler(Of CalendarCustomDisabledDateEventArgs)
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. |
| IsDisabled | Specifies whether the processed date is disabled for selection. |
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 CustomDisabledDate event handlers affect the manner in which the calendar is updated (navigates to another month/year).
true, the calendar initiates a postback to the server; otherwise, it’s updated using callback technology.Tip
We recommend that you use the CalendarCustomDisabledDate event to customize the editor appearance (disabled days) only. If you disable days, handle the Validation event to ensure that users do not enter disabled dates in the editor input.
<dx:ASPxDateEdit ID="dateEdit" runat="server" EditFormat="Custom" Date="2009-11-02 09:23"
OnCalendarCustomDisabledDate="dateEdit_CalendarCustomDisabledDate">
<TimeSectionProperties>
<TimeEditProperties EditFormatString="hh:mm tt" />
</TimeSectionProperties>
<CalendarProperties>
<FastNavProperties DisplayMode="Inline" />
</CalendarProperties>
</dx:ASPxDateEdit>
protected void dateEdit_CalendarCustomDisabledDate(object sender, DevExpress.Web.CalendarCustomDisabledDateEventArgs e)
{
if (e.Date.DayOfWeek == DayOfWeek.Wednesday)
e.IsDisabled = true;
}
Result:
See Also