2 Columns Hide Future Months

2 posts, 0 answers
  1. Philip
    Philip avatar
    2 posts
    Member since:
    Nov 2010

    Posted 15 Oct 2015 Link to this post

    I have a Calendar with 2 columns and by default it control displays the current month at the top with the current month in the first column and the following month in the second (e.g. [October][November]).

    My problem is that I don't want to display dates past the end of the current month so would like the current month in the second column and the previous month in in the first (e.g. [September][October])

     Is there any way to configure the calendar to do this? If I set the DisplayDateEnd to the last day of the current month it still shows the following month (just not selectable). If click on the current month in the header I can select the previous month which displays what I want (except it now shows the previous month in the header)

     Thanks in advance 

  2. Nasko
    Admin
    Nasko avatar
    585 posts

    Posted 19 Oct 2015 Link to this post

    Hi Philip,

    What we could suggest you is to use the DisplayDate property in order to achieve the desired order of the Calendar's column - by setting it to a date of September the desired order could be achieved.

    However, as you you already noticed the Header of the control will also change. Because of that in order to achieve the desired appearance for the header you also need to modify the default template of the Calendar. By using a converter placed inside the Button x:Name="Header" you could modify its Content as needed and the desired name of the month to be visualized.

    We have created a sample project that demonstrates the described above approach and you could run and evaluate it - please, notice that Implicit Styles are used. The sample has not been tested in all scenarios, so you might need to improve its logic in order to work as expected for you.

    Hope this helps.

    Regards,
    Nasko
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft banner
Back to Top