windowsforms-devexpress-dot-xtrascheduler-dot-schedulerdatastorage-10a7e4bf.md
Allows you to set the source object for a newly created appointment.
Namespace : DevExpress.XtraScheduler
Assembly : DevExpress.XtraScheduler.v25.2.dll
NuGet Package : DevExpress.Win.Scheduler
public event EventHandler<CreateSourceObjectEventArgs> CreateSourceObject
Public Event CreateSourceObject As EventHandler(Of CreateSourceObjectEventArgs)
The CreateSourceObject event's data class is DevExpress.XtraScheduler.CreateSourceObjectEventArgs.
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();
}
Private Sub schedulerDataStorage1_CreateSourceObject(ByVal sender As Object, ByVal e As CreateSourceObjectEventArgs) _
Handles schedulerDataStorage1.CreateSourceObject
If TypeOf e.PersistentObject Is Appointment Then
e.SourceObject = New MyAppointmentSourceObject()
End If
End Sub
See Also