Back to Devexpress

SchedulerDataStorage.CreateSourceObject Event

windowsforms-devexpress-dot-xtrascheduler-dot-schedulerdatastorage-10a7e4bf.md

latest2.3 KB
Original Source

SchedulerDataStorage.CreateSourceObject Event

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

Declaration

csharp
public event EventHandler<CreateSourceObjectEventArgs> CreateSourceObject
vb
Public Event CreateSourceObject As EventHandler(Of CreateSourceObjectEventArgs)

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.

csharp
private void schedulerDataStorage1_CreateSourceObject(object sender, CreateSourceObjectEventArgs e) {
    if (e.PersistentObject is Appointment)
        e.SourceObject = new MyAppointmentSourceObject();
}
vb
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

SchedulerDataStorage Class

SchedulerDataStorage Members

DevExpress.XtraScheduler Namespace