Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

SchedulerDataStorage.CreateSourceObject Event

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

Namespace: DevExpress.XtraScheduler

Assembly: DevExpress.XtraScheduler.v24.2.dll

NuGet Package: DevExpress.Win.Scheduler

#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