How to Remove the Last Week Of a Calendar

Posted by Nassign on Stack Overflow See other posts from Stack Overflow or by Nassign
Published on 2010-03-25T08:48:51Z Indexed on 2010/03/25 8:53 UTC
Read the original article Hit count: 376

Filed under:
|
|
|

I am not sure why other people have not asked this before. But have you notice that the asp:Calendar shows an extra week at the end?

For example if the VisibleMonth is set to 2010-03-01 and FirstDayOfWeek to Sunday: It will show 6 weeks.

  1. Feb 28 to March 6
  2. March 7 to March 13
  3. March 14 to March 20
  4. March 21 to March 27
  5. March 28 to April 3
  6. April 4 to April 10

I was wondering why Microsoft shows the last Row which is entirely on April. I tried to search the net for a property but it does not seem to be existing.

The only solution that I could think of is to override the Pre_Render and check all individual date if they are still within the week of the VisibleDate. But of course that is an extreme checking since each rendering of the control shows it.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about calendar