0

我使用 Telerik Demo Sheduler 作为我的基础。我修改了这样的数据加载:

public class SessionAppointmentCollection : ObservableCollection<SessionAppointment>, IAppointmentFactory 
    { 

        /// <summary> 
        /// Gets sample appointments. 
        /// </summary> 
        /// <value>The appointments.</value> 
        public SessionAppointmentCollection(RadScheduler scheduler) 
        { 
//            int month = DateTime.Now.Month; 
//            DateTime mondayDate = CalendarHelper.GetFirstDayOfWeek(DateTime.Today, DayOfWeek.Monday); 
//            DateTime satDate = CalendarHelper.GetFirstDayOfWeek(DateTime.Today, DayOfWeek.Saturday); 
//            DateTime lastsundayDate = CalendarHelper.GetEndOfMonth(DateTime.Today); 



            DataTable dtActions = SqlHelper.GetTable("base_Action_Search");//, new string[] { "@CompanyName", client, "@TaskTypeID", db_TaskTypeID.SelectedValue.ToString() });//, "@Users", Users }); 
            foreach (DataRow dr in dtActions.Rows) 
            { 
                SessionAppointment appointmentas = new SessionAppointment(); 

                appointmentas.UniqueId = dr["ActionID"].ToString(); 
                appointmentas.Subject = dr["ActionName"].ToString(); 
                appointmentas.Body = dr["Comments"].ToString(); 
                DateTime start = Convert.ToDateTime(dr["StartDate"].ToString()); 
                appointmentas.Start = start; 
                appointmentas.End = start.AddMinutes(Convert.ToInt32(dr["Duration"].ToString())); 
                appointmentas.SessionRoom = "01"; 
                appointmentas.Speaker = "Testinis vartotojas"; 
                appointmentas.Level = 300; 
                appointmentas.Category = dr["Priority"].ToString().Equals("-1") ? scheduler.Categories.GetCategoryByName("WebDevelopement") : scheduler.Categories.GetCategoryByName("WindowsAndFrameworks"); ; 

                Add(appointmentas); 
            } 

现在我想实现删除。但我无法访问 UniqueID 属性?我怎么能这样做..?

4

2 回答 2

0

下面的帖子对此有所说明: http ://www.telerik.com/community/forums/wpf/scheduler/uniqueid-property-how-to-access-it.aspx

基本上,您必须将 AppointmentDeletedEventArgs 的 e.Appointment 参数(因为它是 IAppointment 类型)转换为 RadScheduler 的 Appointment 对象才能访问 UniqueId。

于 2009-12-17T11:57:11.943 回答
0

本文给出了以下答案,应该对您有用:

Appointment appointment = appointmentElement.Appointment as Appointment;
Guid appId = appointment.UniqueId;
于 2016-05-13T11:13:55.977 回答