Can render message in the calendar control?

Q

Quentin Huo

Hi:

I want to present some massages in the calender control. Can I do that?

Thanks

Q.
 
G

Guest

Quentin,

I assume you mean to add data to a Day on the calendar? If that is the
case, check out the DayRender event. You can add code within to manipulate
the text of each day. The following is a sample (C#) from VS2003 Help:

void DayRender(Object source, DayRenderEventArgs e)
{

// Change the background color of the days in the month
// to yellow.
if (!e.Day.IsOtherMonth && !e.Day.IsWeekend)
e.Cell.BackColor=System.Drawing.Color.Yellow;

// Add custom text to cell in the Calendar control.
if (e.Day.Date.Day == 18)
e.Cell.Controls.Add(new LiteralControl("<br>Holiday"));

}

Ian Suttle
http://www.IanSuttle.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top