緑とピンクの2色でC#カレンダーの日付を強調表示する方法を教えてください はいの場合、カレンダーセルにdivの色を適用できますか? 現在、私のコードは
if(dt.Rows.Count>1)
{
cell.BackColor = System.Drawing.Color.Yellow;
//cell.Style.Add("font-weight", "bold");
//cell.Style.Add("color", "pink");
//cell.ForeColor = System.Drawing.Color.Pink;
//foreach (var item in collection)
//{
//}
// cell.Controls.Add("divColor");
// cell.BackColor = System.Drawing.Color.Magenta;
}
if (dCalendarDate == tempDate)
{
ViewState["ManagerID"] = iManagerID;
//Session["tempid"] = iManagerID;
// int tempdate1 = iManagerID;
// if (tempid != iManagerID)
//{
// tblColorCodes clr = new tblColorCodes();
//clr.GetColor(tempid);
//}
DateTime tempdate2 = tempDate;
tblColorCodes objColorCode = new tblColorCodes();
objColorCode.GetColor(iManagerID);
string colorCode = objColorCode.ColorCode;
cell.BackColor = System.Drawing.Color.FromName(colorCode);
strJavascript = "javascript:datePic('" + day.Date + "','" + iManagerID + "');";
if (day.Date >= DateTime.Today)
{
cell.Attributes.Add("onclick", strJavascript);
}
}
}
cell.Style.Add("cursor", "pointer");
if (day.Date < DateTime.Now.Date)
{
cell.BackColor = System.Drawing.Color.FromArgb(150, 150, 150);
cell.ToolTip = "You can’t select a date in the past!";
}
//cell.Attributes.Add("onclick", "datePic('" + day.Date + "')");
}