جدولة Telerik "خاصية UniqueID" - كيفية الوصول إليها
-
20-09-2019 - |
سؤال
يمكنني استخدام 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);
}
الآن أريد تنفيذ حذف. لكنني غير قادر على الوصول إلى الممتلكات الفريدة؟ كيف يمكنني أن أفعل ذلك ..؟
المحلول
المنصب أدناه يلقي بعض الضوء على ذلك:http://www.telerik.com/Community/Forums/wpf/scheduler/uniqueid-property-how-to-access-it.aspx.
في الأساس، سيكون عليك إلقاء الوسيطة E.Appointment (لأنه من النوع IAPPointment) للعودة إلى كائن موعد RADSCHEDULER من أجل الوصول إلى UniqueID.
نصائح أخرى
هذه المقالة يعطي الإجابة التالية، والتي يجب أن تعمل من أجلك:
Appointment appointment = appointmentElement.Appointment as Appointment;
Guid appId = appointment.UniqueId;
لا تنتمي إلى StackOverflow