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
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.
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
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.
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
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 >>
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.
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.