土日の色を変える
private void gcMultiRow1_CellFormatting(object sender, CellFormattingEventArgs e)
{
if (e.Scope == CellScope.Row)
{
try
{
//土日の色を変える
if (e.CellName == "gcDateTimeCell1" && e.Value != null)
{
DateTime s = (DateTime)e.Value;
if (s.ToString("MMM d dd ddd").IndexOf("土") > 0)
e.CellStyle.ForeColor = Color.Blue;
else if (s.ToString("MMM d dd ddd").IndexOf("日") > 0)
e.CellStyle.ForeColor = Color.Red;
e.FormattingApplied = true;
}
}
catch { }
}
}
