BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
[C#]
calendar.OnMonthCellLoaded += Calendar_OnMonthCellLoaded; …
private void Calendar_OnMonthCellLoaded(object sender, MonthCellLoadedEventArgs args)
{
// As default setting Month cell Background color as Green
args.BackgroundColor = Color.Green;
appointments = calendar.DataSource as CalendarEventCollection;
for (int i = 0; i < appointments.Count; i++)
{
var appointment = appointments[i];
if (args.Date.Date == appointment.StartTime.Date)
{
// Setting Background color when the appointment available on specific day
args.BackgroundColor = Color.Red;
}
}
} |
private void Calendar_OnMonthCellLoaded(object sender, MonthCellLoadedEventArgs args)
{
if ((calendar.DataSource as CalendarEventCollection).All(x => x.StartTime.Date != args.Date.Date))
args.BackgroundColor = Color.LightGreen;
}