If you extended the default DevExpress.Persistent.BaseImpl.Event class or implemented your own class, supporting the DevExpress.Persistent.Base.IEvent interface, then you may face the situation when custom fields added to your class won't be copied when copying appointments in the scheduler control. To make it possible, you should manually map your custom data fields to appropriate appointment fields. The How to: Create a Custom Field for an Appointment help topic provides more information on how to do this.
In this example, we have a descendant of the Event class that has two properties with the RuleRequiredFieldAttribute. After adding custom field mappings to the controllers, if we drag and drop an existing appointment in the scheduler control with the Control key pressed, we won't receive a validation exception because custom fields will be correctly copied.
However, adding custom field mappings won't help if we have collection properties, for example, an associated details collection. In this situation, you should handle copying of appointments yourself. The scheduler control provides corresponding API for this. For example, check the SchedulerControl.AllowAppointmentCopy Event help topic for more information.
See Also:
Scheduler Module Overview
How to create fully custom Role, User, Event, Resource classes for use with the Security and Scheduler modules
Scheduler - Provide a way to copy a collection of custom fields when an appointment is being copied
Question Comments
Added By: Lleonard del Río at: 7/16/2014 12:35:02 PM
I had this code in my solution in v2013 and after upgrading to v2014 it stopped working. I have tried to remove the ! after the reference fields mapping and it seems to work correctly now. Should this code be updated for v2014? Thanks in advance.
Added By: Dennis (DevExpress Support) at: 7/17/2014 12:28:27 AM @Lleonard: Thank you for your feedback. We need some additional time to research this behavior. Please bear with us.