date picker setting for selecting only month and year.

8 posts, 0 answers
  1. Anil
    Anil avatar
    58 posts
    Member since:
    Nov 2007

    Posted 22 Dec 2009 Link to this post

    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
  2. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 23 Dec 2009 Link to this post

    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.
  3. UI for WPF is Visual Studio 2017 Ready
  4. David
    David avatar
    7 posts
    Member since:
    Jun 2009

    Posted 05 Feb 2010 Link to this post

    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

  5. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 09 Feb 2010 Link to this post

    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.
  6. Michael
    Michael avatar
    105 posts
    Member since:
    Nov 2010

    Posted 12 Jul 2013 Link to this post

    Is this feature implemented now?
  7. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 17 Jul 2013 Link to this post

    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 >>
  8. PRABAKARAN
    PRABAKARAN avatar
    1 posts
    Member since:
    May 2014

    Posted 19 Nov 2014 Link to this post

    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.

  9. Nasko
    Admin
    Nasko avatar
    587 posts

    Posted 19 Nov 2014 Link to this post

    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.

     
Back to Top
UI for WPF is Visual Studio 2017 Ready