This is a migrated thread and some comments may be shown as answers.

date picker setting for selecting only month and year.

7 Answers 2172 Views
DatePicker
This is a migrated thread and some comments may be shown as answers.
Anil
Top achievements
Rank 2
Anil asked on 22 Dec 2009, 01:17 PM
Hi,
I want my date picker to show only months and year in the calender. and on selection the date picker should show only the selected month and year(mm/yy). This kind of date picker is required in case of getting expiry date for credit card.
I tried to set some formatting string in my xaml page but it didn work.
Any help in this regard will be appreciating.

Thanks,
Anil

7 Answers, 1 is accepted

Sort by
0
Konstantina
Telerik team
answered on 23 Dec 2009, 09:02 AM
Hello Anil,

Straight to your question.

To achieve your goal you can use MaskedTextBox for the DatePicker that will format the date as you wish. Attached is a project illustrating that approach.
If you have any further questions please feel free to ask.

All the best,
Konstantina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
David
Top achievements
Rank 1
answered on 05 Feb 2010, 08:56 PM

I am very interested in this same situation.  I downloaded the sample app and got it to run in WPF (no Silverlight installed here).  I noticed that with the popup I can set it to DisplayMode=YearView and it almost works perfectly.  However, it still requires the user to select a specific day.  Is there any way to have the popup close once the month is selected?  What I'm getting at is that, like the OP, I need my user to simply select an expiration month.  There's no need for them to select a day as the code behind the scenes will assume last day of the month.  So it's not just an issue of displaying only MM/yyyy but also restricting selection.  I like the DatePicker as it has some slick animation moving from year to month etc and would love it if we could use it for this situation.

Thanks,
David

0
Konstantina
Telerik team
answered on 09 Feb 2010, 09:26 AM
Hello David,

Thank you for contacting us.

Unfortunately, this cannot be achieved with the current implementation of the control. We will do our best to improve the selection behaviour of the DatePicker for one of our future releases.

If you have any other concerns about our controls please feel free to contact us again.

Regards,
Konstantina
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
Michael
Top achievements
Rank 1
answered on 13 Jul 2013, 04:00 AM
Is this feature implemented now?
0
Konstantina
Telerik team
answered on 17 Jul 2013, 09:07 AM
Hi,

There are 2 options for this scenario: a DateSelectionMode can be set. More information you could find in this help article: http://www.telerik.com/help/wpf/raddatetimepicker-features-date-selection-modes.html and in order to display the text in the preferred way you could implement custom parsing. More information about this you could find in this help article: http://www.telerik.com/help/wpf/raddatetimepicker-how-to-implement-custom-parsing.html

Regards,
Konstantina
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
PRABAKARAN
Top achievements
Rank 1
answered on 19 Nov 2014, 07:07 AM
Hi,

I want my date picker to show only months and year in the calender. and
on selection the date picker should show only the selected month and
year(mm/yy). This kind of date picker is required in case of getting
expiry date for credit card.

I tried to set some formatting string in my Android page but it didn work.

Any help in this regard will be appreciating.

0
Nasko
Telerik team
answered on 19 Nov 2014, 12:45 PM
Hello,

In order to visualize only months and years in the DateTimePicker control you need to set the InputMode property to DatePicker and the DateSelectionMode property to Month. More detailed information about the different input modes you could find on the following link:
http://www.telerik.com/help/wpf/raddatetimepicker-features-input-modes.html

About the format of the date, the DateTimePicker control provides the functionality to change the way the date is formatted. Please, check the following article in our help documentation that provides a detailed information about how to achieve this:
http://www.telerik.com/help/wpf/raddatetimepicker-features-formatting.html

We have created a sample project that demonstrates the described above  approach. Please, give it a try and let us know if it worked for you.

Regards,
Nasko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
DatePicker
Asked by
Anil
Top achievements
Rank 2
Answers by
Konstantina
Telerik team
David
Top achievements
Rank 1
Michael
Top achievements
Rank 1
PRABAKARAN
Top achievements
Rank 1
Nasko
Telerik team
Share this question
or