Using custom AppointmentMappingInfo fields with a non-Telerik edit appt form.

2 posts, 0 answers
  1. Oliver
    Oliver avatar
    17 posts
    Member since:
    Aug 2008

    Posted 22 Oct 2012 Link to this post

    I have a Telerik Radscheduler embedded in a non-Telerik program that uses a non-Telerik edit appointment form.  I want to add a custom field to AppointmentMappingInfo to pass in a field that is an ID that is used to tell the non-Telerik program what appointment information to load into the form.

    I followed this tutorial: http://www.telerik.com/help/winforms/scheduler-data-binding-binding-to-custom-fields.html to implement it, however it seems this will only work if you use a customized version of the Telerik edit appointment form since the custom Appointment is passed as an IEvent into the custom form's LoadSettingsFromEvent() function.  How can I get access to my custom appointments when I'm using a non-Telerik edit appointment form?

    Thanks.
  2. Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 23 Oct 2012 Link to this post

    Hello,

    Thank you for contacting us.

    The LoadSettingsFromEvent method as well as all other properties of the EditAppointmentDialog are added for convenience of the users inheriting from this dialog. The entirely custom edit dialogs should implement the IEditAppointmentDialog. The EditAppointment method of this interface is the one that you should use to assign the edited appointment to the dialog. The IEvent is an interface that all appointment types should implement and is used for extensibility. Therefore, to get your custom appointment, you need to cast to the custom type. Below is a very basic implementation of a non-Telerik custom edit dialog.
    public class MyEditDialog : Form, IEditAppointmentDialog
    {
        CustomAppointment myCustomAppointment;
        ISchedulerData schedulerData;
     
        public void ShowRecurrenceDialog()
        {
            return;
        }
     
        public bool EditAppointment(IEvent appointment, ISchedulerData schedulerData)
        {
            this.myCustomAppointment = appointment as CustomAppointment;
            this.schedulerData = schedulerData;
     
            if (this.myCustomAppointment == null)
            {
                return false;
            }
     
            return true;
        }
     
     
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
     
            if (this.myCustomAppointment != null)
            {
                this.LoadSettingsFromEvent(myCustomAppointment);
            }
        }
     
        protected virtual void LoadSettingsFromEvent(CustomAppointment appointment)
        {
            //TODO load your settings here
        }
    }

    I hope you find this useful. Please let me know if you have any further questions.

    Regards,
    Ivan Todorov
    the Telerik team
    You’ve been asking for it and now it’s time for us to deliver. RadControls for WinForms Q3 2012 release is just around the corner. Sign up for a free webinar to see first all the latest enhancements.
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top