# Disable Dates

Read the topic to know more about DateEdit control for WinForms.

## Content



Disabled dates are the ones that appear disabled and are not selectable at run-time. You can add disabled dates at design-time through [DateTime Collection Editor](/componentone/docs/win/online-calendar/calendarview-overview/calendarview-designer). You can also add disabled dates through code in CalendarView by setting the DisabledDates property to a [DateTime](https://docs.microsoft.com/en-us/dotnet/api/system.datetime?view=net-5.0) array. (A DateTime constructor represents an instant in time, expressed typically as a date and time of the day.)

The following image shows disabled dates in CalendarView.

![](https://cdn.mescius.io/document-site-files/images/1b33a1f1-17e3-4593-a233-97e8b8ff7610/images/disableddates-calendarview.png)

The following code snippet shows how to add disabled dates using the **DisabledDates** property in CalendarView:

```csharp
// Set disabled dates
calendarView.DisabledDates = new DateTime[]
            {               
    new DateTime(2021, 05, 16),
    new DateTime(2021, 05, 17),
    new DateTime(2021, 05, 18),
    new DateTime(2021, 05, 19),
    new DateTime(2021, 05, 20),
    new DateTime(2021, 05, 21),
    new DateTime(2021, 05, 22)
            };
```