Only Display Certain Months when DateSelectionMode=Month (aka SelectionMode = Quarter)

2 posts, 0 answers
  1. Aaron
    Aaron avatar
    14 posts
    Member since:
    Feb 2012

    Posted 02 Aug 2012 Link to this post

    I am using the DatePicker to allow selection of Quarters (1st Quarter 2012, 3rd Quarter 2013, etc).  Is there a way to only display some months when the DateSelectionMode=Month?  I only want to display Jan, Apr, Jul, Oct.  Something similar to the attached image.
  2. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 07 Aug 2012 Link to this post

    Hello Aaron,

    In order to get the required behavior in the DatePicker control you will need to customize the CalendarStyle and create a custom MonthButtonStyleSelector. We prepared and attached a sample project for you representing the described approach. Notice that the non required months are not removed, but disabled. There is no way to completely remove them as the MonthButtons are put in an UniformGrid in code-behind and this behavior cannot be overridden.

    Hope this is helpful to achieve the needed behavior.

    Greetings,
    Vladi
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
Back to Top