开发者

Asp.net calendar do not render previous/next days

How to do it. For example the calend开发者_运维百科ar for march will also show days from feb and april. I dont want them to be shown. How to do. Anyone have sample code?


In the DayRender event, check the date. If it falls in the previous or the next month, make the cell's text a  


public void objCalendar_DayRender(object sender, DayRenderEventArgs e)
{
    CalendarDay d = ((DayRenderEventArgs)e).Day;

    TableCell c = ((DayRenderEventArgs)e).Cell;
    if (d.IsOtherMonth)
    {
        c.Controls.Clear();
    }
    else
    {
            //stuff
    }
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜