The defa开发者_如何学运维ult asp.net calendar renders with 6 displayable weeks, the last week is always the 'next' month and i dont care about it. Is there a way to display only 5 weeks?
I've done quite a bit of work with it as of late and I don't think so. It's a very limited calendar. I've been looking at fullcalendar as an alternative.
Edit, you can make days out side of the current month unselectable on the dayrender event, or even better. Assign a css class that hides the contents of days outside of the current month
Here is what I did and is seems to look ok. It does not actually remove the week but blanks the day out.
protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
{
if (e.Day.Date.Month != this.Calendar1.VisibleDate.Month) {
e.Cell.Text=" ";
}
}
And the output. It's not a perfect solution but it does the trick.
See Output
精彩评论