This is a migrated thread and some comments may be shown as answers.

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

1 Answer 81 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Oliver
Top achievements
Rank 1
Oliver asked on 22 Oct 2012, 08:17 PM
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.

1 Answer, 1 is accepted

Sort by
0
Ivan Todorov
Telerik team
answered on 23 Oct 2012, 01:29 PM
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.
Tags
Scheduler and Reminder
Asked by
Oliver
Top achievements
Rank 1
Answers by
Ivan Todorov
Telerik team
Share this question
or