Telerik Scheduler“UniqueId 属性” - 如何访问它

发布于 2024-08-15 08:00:52 字数 2033 浏览 2 评论 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 属性?我怎样才能做到这一点..?

i use Telerik Demo Sheduler as my base. I have modified data loading like this:

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); 
            } 

Now i want to implement deleting. But i cant access UniqueID property? How I can do that..?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

梨涡少年 2024-08-22 08:00:52

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

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

The post below sheds some light on that:
http://www.telerik.com/community/forums/wpf/scheduler/uniqueid-property-how-to-access-it.aspx

Basically, you will have to cast the e.Appointment argument (because it is of type IAppointment) of the AppointmentDeletedEventArgs to RadScheduler's Appointment object in order to have access to UniqueId.

圈圈圆圆圈圈 2024-08-22 08:00:52

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

Appointment appointment = appointmentElement.Appointment as Appointment;
Guid appId = appointment.UniqueId;

This article gives the following answer, which should work for you:

Appointment appointment = appointmentElement.Appointment as Appointment;
Guid appId = appointment.UniqueId;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文