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.v20.1.dll

Declaration

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

Property Value

Type Default Description
DevExpress.XtraEditors.Controls.ICalendarDisabledDateProvider

null

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