2009-12-17 66 views
0

我使用Telerik Demo Sheduler作爲我的基礎。我已經修改了這樣的數據加載:Telerik Scheduler「UniqueId property」 - 如何訪問它

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屬性?我怎麼能這樣做..?

回答

0

This article給出了以下的答案,這應該爲你工作:

Appointment appointment = appointmentElement.Appointment as Appointment; 
Guid appId = appointment.UniqueId; 
相關問題