Use the DayRender event for the calendar then target the days. Here
is some sample code that changes the background color of the cell if
there is a database entry for an appointment on any given day:
private void Calendar1_DayRe nder(object sender,
System.Web.UI.W ebControls.DayR enderEventArgs e)
{
foreach (DataRow row in ds.Tables["Calendar"].Rows){
try {
DateTime eventdate=(Date Time)row["event_start_ti me"];
if
(eventdate.ToSh ortDateString() .Equals(e.Day.D ate.ToShortDate String()))
{
Here's what you want: e is coming of the DayRender method and gives
you a particular cell
----> e.Cell.BackColo r=System.Drawin g.Color.FromArg b(230,179,1); <--
}
}
catch
{
//if it can't do it, then so
be it
}
}
}
}
On 5 Jan 2004 21:10:27 -0600,
hk**********@ya hoo.co-dot-jp.no-spam.invalid (michael_hk) wrote:
Hi,
I am new to Windows Form programming and now have a simple Q about
MonthCalenda r.
I want to hightlight some days in the calendar by changing the
background color of these days. But I can't find any property or
method that let me do this. What I know is that I can bold them...
Thanks.
Michael
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---