Make calendar events on ASP.NET
- Drag Calendar Control to Your WebForm
- Choose Event Menu
- Find DayRender
- Double Click
//Here's the codes
protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
{
List dt = new List();
for (int i = 0; i < 5; i++)
{
DateTime myevent = new DateTime(2012,02,2+2*i);
dt.Add(myevent);
}
foreach (var item in dt)
{
if (e.Day.Date == item)
{
e.Cell.ForeColor = Color.White;
e.Cell.BackColor = Color.BlueViolet;
e.Cell.Text = e.Day.DayNumberText;
e.Cell.ToolTip = "tooltip untuk tgl " + e.Day.DayNumberText;
}
}
}
No comments:
Post a Comment