I am using a monthCalendar to show year's holidays.
I prefer changing the BackColor of the specified dates but as far as I know its not possible with this control.
when trying to load holiday dates to the BoldedDates using a dynamic array with no success.
this is the code im using:
would love to get any working example.
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
I'm not sure if you can Calendar1_DayRender event..
protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
{
if (! e.Day.IsOtherMonth )
{
foreach (DataRow dr in ds.Tables[0].Rows)
{
if ((dr["EventDate"].ToString() != DBNull.Value.ToString()))
{
DateTime dtEvent= (DateTime)dr["EventDate"];
if (dtEvent.Equals(e.Day.Date))
{
e.Cell.BackColor = Color.PaleVioletRed;
}
}
}
}
//If the month is not CurrentMonth then hide the Dates
else
{
e.Cell.Text = "";
}
}
Hagita
ASKER
Hi Dhaest, the DayRender event does not exist so its impossible.
it is very strange since the functionality im looking for is common in other microsoft dev. tools like access etc'.
Hagita
ASKER
great sample codes -Thanks!
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
protected void Calendar1_DayRender(object
{
if (! e.Day.IsOtherMonth )
{
foreach (DataRow dr in ds.Tables[0].Rows)
{
if ((dr["EventDate"].ToString
{
DateTime dtEvent= (DateTime)dr["EventDate"];
if (dtEvent.Equals(e.Day.Date
{
e.Cell.BackColor = Color.PaleVioletRed;
}
}
}
}
//If the month is not CurrentMonth then hide the Dates
else
{
e.Cell.Text = "";
}
}