1

我正在尝试为 Telerik 调度程序的约会创建一个自定义添加页面。我希望显示我的页面而不是调度程序中内置的添加约会模板。我查看了高级插入模板,但我认为它不允许重定向到自定义页面。

4

1 回答 1

0

这是我在 WPF 中使用的 - 我假设您使用的是 Silverlight,所以 YMMV:

//in your window's constructor, add:

Sched.AddHandler(AppointmentItemsControl.SelectionChangedEvent, new SelectionChangedEventHandler(ShowCustomApptForm), true); 


//then handle the event like this:
        public void ShowCustomApptForm(object sender, SelectionChangedEventArgs args)
        {
            if (args.AddedItems.Count > 0)
            {
                AppointmentSlot item = args.AddedItems[args.AddedItems.Count - 1] as AppointmentSlot;
                if (item != null)
                {
                    //Get the appointment object so we can access the UniqueID    
                    Appointment SelAppt = (Appointment)item.Occurrence.Master;
                    //Open the custom form, passing the uniqueid to the constructor
                    MyCustomForm ApptFrm = new MyCustomForm(Convert.ToInt32(SelAppt.UniqueId));
                    ApptFrm.Show();

                }
            }

        }
于 2011-03-17T02:33:59.300 回答