ADAdministrator Syncfusion Team April 18, 2005 02:41 PM
While there isn''t a property to disable dates, MonthCalendarAdv offers an event, DateCellQueryInfo, that allows you to customize individual cells in the calendar. For example, the following code snippet demonstrates disabling all days before DateTime.Today in the imbedded MonthCalendarAdv of a DateTimePicker:
private void dateTimePickerAdv1_Calendar_DateCellQueryInfo(object sender, Syncfusion.Windows.Forms.Tools.DateCellQueryInfoEventArgs e)
if ((DateTime)(e.DateValue) < DateTime.Today)
e.Style.Font.Strikeout = true;
e.Style.TextColor = Color.Gray;
e.Style.Enabled = false;
Hope this helps.
JOJohnApril 18, 2005 03:44 PM
Thanks for the prompt reply. The dates are disabled, but if user clicks on any disabled date, then the calendar automatically treats as if the click is performed for the currently selected date. The date in the DatePickerAdv is refreshed to the currently selected date, so no change there, but the MonthCalendarAdv popup disappear. Is this an expected behavior?
ADAdministrator Syncfusion Team April 19, 2005 10:38 AM
Yes, that is the expected behavior of the PopupControlContainer. However, if you want to change that functionality you could use the CustomPopupWindow property to create your own popup with custom behavior.