protected void ASPxScheduler1_AppointmentViewInfoCustomizing(object sender, DevExpress.Web.ASPxScheduler.AppointmentViewInfoCustomizingEventArgs e) { Random r = new Random(); e.ViewInfo.AppointmentStyle.BackColor = Color.Firebrick; if (Int32.Parse(e.ViewInfo.Appointment.Id.ToString()) % 2 == 0) { e.ViewInfo.AppointmentStyle.BackColor = Color.Red; } if (Int32.Parse(e.ViewInfo.Appointment.Id.ToString()) % 3 == 0) { e.ViewInfo.AppointmentStyle.BackColor = Color.Blue; } if (Int32.Parse(e.ViewInfo.Appointment.Id.ToString()) % 5 == 0) { e.ViewInfo.AppointmentStyle.BackColor = Color.Yellow; } if (Int32.Parse(e.ViewInfo.Appointment.Id.ToString()) % 7 == 0) { e.ViewInfo.AppointmentStyle.BackColor = Color.Green; } if (Int32.Parse(e.ViewInfo.Appointment.Id.ToString()) % 11 == 0) { e.ViewInfo.AppointmentStyle.BackColor = Color.MediumAquamarine; } }
protected void ASPxScheduler1_AppointmentViewInfoCustomizing(object sender, DevExpress.Web.ASPxScheduler.AppointmentViewInfoCustomizingEventArgs e) { if (e.ViewInfo.Appointment.CustomFields["AppointmentUser"] == null || (e.ViewInfo.Appointment.CustomFields["AppointmentUser"] != null && e.ViewInfo.Appointment.CustomFields["AppointmentUser"].ToString() != ASPxComboBoxUsers.Value.ToString())) { e.ViewInfo.AppointmentStyle.BackColor = System.Drawing.Color.LightGray; e.ViewInfo.AppointmentStyle.ForeColor = System.Drawing.Color.Gray; } }