protected void CalendarDRender(object sender, System.Web.UI.WebControls.DayRenderEventArgs e) { // If the month is CurrentMonth 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=Colors.Red;//Colors does not exist in the current context i develop calender and on which date i set event color of that date change } } } } //If the month is not CurrentMonth then hide the Dates else { e.Cell.Text = ""; } }
using System.Drawing; e.Cell.BackColor = Color.Red
e.Cell.BackColor = System.Drawing.Color.Red;
System.Drawing
string.Empty
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)