Back to Devexpress

RepositoryItemDateEdit.DisabledDateProvider Property

windowsforms-devexpress-dot-xtraeditors-dot-repository-dot-repositoryitemdateedit-f7338def.md

latest3.1 KB
Original Source

RepositoryItemDateEdit.DisabledDateProvider Property

Allows you to assign an ICalendarDisabledDateProvider object that can disable certain dates to prevent them from being selected by an end-user.

Namespace : DevExpress.XtraEditors.Repository

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[DefaultValue(null)]
[DXCategory("Appearance")]
public ICalendarDisabledDateProvider DisabledDateProvider { get; set; }
vb
<DefaultValue(Nothing)>
<DXCategory("Appearance")>
Public Property DisabledDateProvider As ICalendarDisabledDateProvider

Property Value

TypeDefaultDescription
DevExpress.XtraEditors.Controls.ICalendarDisabledDateProvidernull

An object that can disable certain dates to prevent them from being selected by an end-user.

|

Remarks

Disabled dates cannot be selected by an end-user in the editor’s drop-down or by typing them in the edit box.

You can disable certain dates by using one of the following approaches:

  • Handle the RepositoryItemDateEdit.DisableCalendarDate event
  • Implement an ICalendarDisabledDateProvider object, which marks specific dates as “disabled”, and assign this object to the DisabledDateProvider property.

Disabled dates are painted with a strikethrough. You can provide custom appearance settings used to paint disabled dates with the RepositoryItemDateEdit.AppearanceCalendar property.

If a disabled date is entered in the edit box and focus is about to be moved away to another control, an error occurs, which is indicated by an error icon. You can respond to this error by handling the BaseEdit.InvalidValue event. In container controls (e.g., GridControl and TreeList), handle the InvalidValueException event provided by these controls (e.g., BaseView.InvalidValueException and TreeList.InvalidValueException).

See Also

DisableCalendarDate

RepositoryItemDateEdit Class

RepositoryItemDateEdit Members

DevExpress.XtraEditors.Repository Namespace