开发者

ASP.NET calendar shows 6 weeks, how can i make it display 5?

开发者 https://www.devze.com 2022-12-22 19:17 出处:网络
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 qu

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

0

精彩评论

暂无评论...
验证码 换一张
取 消