开发者

Asp.net calendar do not render previous/next days

开发者 https://www.devze.com 2022-12-26 05:37 出处:网络
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 t

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

精彩评论

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