We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Disabling certain dates in MonthCalendarAdv

Thread ID:





27775 Apr 18,2005 06:08 PM UTC Apr 19,2005 03:38 PM UTC WinForms 3
Tags: Tools
Asked On April 18, 2005 06:08 PM UTC

Hello, Is there any property in MonthCalendarAdv or DateTimePickerAdv that I can use to disable a set of dates? The user should not be able to click on these dates when making selection. Thanks, John

Administrator [Syncfusion]
Replied On April 18, 2005 07:41 PM UTC

Hi John, 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. Regards, Gregory Austin Syncfusion Inc.

Replied On April 18, 2005 08:44 PM UTC

Greg, 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? Thanks again, John

Administrator [Syncfusion]
Replied On April 19, 2005 03:38 PM UTC

Hi John, 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. Regards, Gregory Austin Syncfusion Inc.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon