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

2 Columns Hide Future Months

1 Answer 15 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 16 Oct 2015, 12:16 AM

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 

1 Answer, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 19 Oct 2015, 12:57 PM
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
Tags
Calendar
Asked by
Mike
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Share this question
or