我正在从数据表中读取约会。这是我的代码:
List<MyClass> myObjects = (from e in myEntities.Mytable where
e.DateFrom >= schedulerInfo.ViewStart &&
e.DateTo <= schedulerInfo.ViewEnd
select e).ToList();
List<Appointment> appointments = new List<Appointment>(myObjects.Count);
foreach (MyClass e in myObjects) {
Appointment a = new Appointment();
a.ID = e.ID;
a.Subject = e.Description;
a.Start = e.DateFrom;
a.End = e.DateTo;
a.BackColor = System.Drawing.Color.Yellow;
appointments.Add(a);
当我跑的时候,它不是黄色的!
答案 0 :(得分:2)
要更改RadScheduler中约会的颜色,您必须订阅OnAppointmentDataBound event。在this documentation article中可以看到,您所要做的就是从e.Appointment
获取当前约会对象并定义BackColor(以及其他可用属性),您应该全部设置好!