Skip to main content

SchedulerDataStorage.CreateSourceObject Event

Allows you to set the source object for a newly created appointment.

Namespace: DevExpress.XtraScheduler

Assembly: DevExpress.XtraScheduler.v24.2.dll

Declaration

public event EventHandler<CreateSourceObjectEventArgs> CreateSourceObject

Event Data

The CreateSourceObject event's data class is DevExpress.XtraScheduler.CreateSourceObjectEventArgs.

Remarks

When a new appointment, resource, status or label is created, the scheduler automatically creates an object that represents the appointment in the bound data source and performs an Insert operation to store the appointment’s data. The CreateSourceObject event fires before the source object is created and allows you to create it manually. Use the SourceObject event argument to specify the source object. The PersistentObject event argument provides access to the created appointment.

private void schedulerDataStorage1_CreateSourceObject(object sender, CreateSourceObjectEventArgs e) {
    if (e.PersistentObject is Appointment)
        e.SourceObject = new MyAppointmentSourceObject();
}
See Also