Blog Reader RSS LoveCherry 技术无极限 GEO MVP MS Project开源技术

Event calendar[摘抄]

转载地址:http://www.codeproject.com/KB/aspnet/EventCalendar.aspx
key to know:
It is quite simple and straight forward. ASP.NET Calendar control posses an event "DayRender" which has got "DayRenderEventArgs" as one of the parameters. This DayRenderEventArgs has got two very useful things - Day and Cell. Day is of the type "CalendarDay" and Cell is f the type "TableCell". Day can help us in identifying the day, date etc which it is going to render and Cell gives us handle to the table cell corresponding to that day. Now since we have handle to Table Cell of displaying Date, we can play with it to cater to our needs. For event Calendar we are simply going to use this event to add the event details in the Table Cells associated with the dates.
CalendarDay d = ((DayRenderEventArgs)e).Day; 
        TableCell c 
= ((DayRenderEventArgs)e).Cell;    
    
        
if ( !d.IsOtherMonth )    
            c.Controls.Add(
new LiteralControl(dr["EventDetails"].ToString()));
posted @ 2008-04-09 12:14  大宋提刑官  阅读(159)  评论(0编辑  收藏  举报