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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Select month only using DateTimePicker

Thread ID:

Created:

Updated:

Platform:

Replies:

95917 Aug 10,2010 11:13 AM UTC Aug 11,2010 11:05 AM UTC Windows Forms 1
loading
Tags: Tools
Jonas Westling
Asked On August 10, 2010 11:13 AM UTC

Is there any way to use the DateTimePickerAdv to select only year and month and hide the selection of date from the user?

Lingaraj S [Syncfusion]
Replied On August 11, 2010 11:05 AM UTC

Hi Jonas,

Thank you for your interest in Syncfusion products.

Please try using DateCellQueryInfo event with DataTimePickerAdv to avoid the Date selection as shown below.

private void dateTimePickerAdv1_Calendar_DateCellQueryInfo(object sender, Syncfusion.Windows.Forms.Tools.DateCellQueryInfoEventArgs e)
{
if (((DateTime)e.DateValue).Day != dateTimePickerAdv1.Value.Day)
{
e.Style.Enabled = false;
e.Style.Font.Strikeout = true;
e.Style.TextColor = Color.Gray;
}
}


Also refer the Knowledgebase article from following link
http://www.syncfusion.com/support/kb/1327/Where-should-we-do-the-validation-when-a-user-selects-a-date-from-the-DateTimePickerAdv-controlAlso-the-date-selected-or-entered-cannot-be-prior-than-today

Please let me know if you have any queries.

Regards,
Lingaraj S.

CONFIRMATION

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.

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

;