开发者

How to add custom 'Add Appointment' page for telerik scheduler?

开发者 https://www.devze.com 2023-01-24 08:42 出处:网络
I am trying to create a custom add page for appointments for telerik scheduler. I want my page to be displayed rather than the add appointment template built in the sch开发者_StackOverflow社区eduler.

I am trying to create a custom add page for appointments for telerik scheduler. I want my page to be displayed rather than the add appointment template built in the sch开发者_StackOverflow社区eduler. I looked at the Advanced Insert Template but I don't think it allows redirecting to a custom page.


This is what I use in WPF- I assume you're using Silverlight so 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();

                }
            }

        }
0

精彩评论

暂无评论...
验证码 换一张
取 消