XtraSchedule显示自定义约会标题

时间:2011-04-07 09:06:05

标签: c# devexpress schedule

我想更改每个约会标题,而不是显示应用的时间 我尝试了InitAppointmentDisplayText事件,但它只更改了应用的工具提示

private void schedulerControl1_InitAppointmentDisplayText(object sender, AppointmentDisplayTextEventArgs e)
        {
            e.Text = string.Format("Schedule: {0}, Time: {1}", e.Appointment.Description, e.Appointment.Start.ToShortTimeString());
            e.Description = string.Format("Schedule: {0}, Time: {1}", e.Appointment.Description, e.Appointment.Start.ToShortTimeString());
        }

enter image description here

1 个答案:

答案 0 :(得分:3)

您应该处理InitAppointmentDisplayText事件并设置Scheduler.Views.MonthView属性,如下所示:

schedulerControl1.Views.MonthView.AppointmentDisplayOptions.EndTimeVisibility = DevExpress.XtraScheduler.AppointmentTimeVisibility.Never;

schedulerControl1.Views.MonthView.AppointmentDisplayOptions.StartTimeVisibility = DevExpress.XtraScheduler.AppointmentTimeVisibility.Never;

schedulerControl1.Views.MonthView.AppointmentDisplayOptions.TimeDisplayType = DevExpress.XtraScheduler.AppointmentTimeDisplayType.Text;

        private void schedulerControl1_InitAppointmentDisplayText(object sender, DevExpress.XtraScheduler.AppointmentDisplayTextEventArgs e) {
            e.Text = "test";
        }        

<强>更新

请参阅我们的文档中的以下主题,以了解如何实现自定义编辑表单:

How to: Create a Custom EditAppointment Form with Custom Fields

How to: Create a Custom Appointment Recurrence Form