Telerik Scheduler "Свойство UniqueId" - как получить к нему доступ - PullRequest
0 голосов
/ 17 декабря 2009

Я использую 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?Как я могу это сделать ..?

Ответы [ 2 ]

0 голосов
/ 13 мая 2016

Эта статья дает следующий ответ, который должен работать для вас:

Appointment appointment = appointmentElement.Appointment as Appointment;
Guid appId = appointment.UniqueId;
0 голосов
/ 17 декабря 2009

Пост ниже проливает свет на это: http://www.telerik.com/community/forums/wpf/scheduler/uniqueid-property-how-to-access-it.aspx

По сути, вам придется привести аргумент e.Appointment (поскольку он имеет тип IAppointment) из AppointmentDeletedEventArgs в объект Appointment RadScheduler, чтобы иметь доступ к UniqueId.

...