2

As the title of my question says: Is there a possibility to show the correspodending CalendarWeek in the WPF DatePicker-Control?

With WinForms there was the possibility to show it on the left-hand-side of the calendar. How to achieve this in WPF?

UPDATE: Thanks to the good answer of Mare Infinitus I were able to find the correct (working for me) solution in the blog of Charles Petzold.

I just had to change the logic to calculate the weeknumber to pass iso-standards! :)

basti
  • 2,649
  • 3
  • 31
  • 46
  • @MareInfinitus: You're right, I could have written down that I read the docs and looked in the MSDN. Usually your comment is written by me ;) – basti Jul 12 '12 at 14:17
  • Okay then, you will find the source code needed in my answer. hope it helps. – Mare Infinitus Jul 12 '12 at 14:47

1 Answers1

3

First of all: Yes, it is possible:

Here is the sourcecode that you wanted: Datepicker final with calender weeks

Please take a look on the WeekColumnVisibility property.

For your interest, here is more information on Customizing the New WPF Calendar Controls

here is a SO on determining the week of the year (quite easy in the end)

Here is some detailed information what to do with such a control. Introducing the WPF 4 Calender Control

and, if you like it, here are some quick and hands on examples on calenders at WPF Tutorial

Community
  • 1
  • 1
Mare Infinitus
  • 8,024
  • 8
  • 64
  • 113
  • But what is strange is that it really needs to be rewritten?! (It was rather dirty but easy in WinForms --> http://forum.codejock.com/forum_posts.asp?TID=17826&title=how-to-show-week-numbers-in-datetimepicker) – basti Jul 12 '12 at 15:11
  • Not everything can be delivered in the first place. Perhaps future versions will have this feature. – Mare Infinitus Jul 12 '12 at 15:52