AppointmentStorage.CommitIdToDataSource Property

Gets or sets whether the appointment ID value should be passed to the data source.

Namespace: DevExpress.XtraScheduler

Assembly: DevExpress.XtraScheduler.v20.1.dll

Declaration

[DefaultValue(false)]
public bool CommitIdToDataSource { get; set; }
<DefaultValue(False)>
Public Property CommitIdToDataSource As Boolean

Property Value

Type Default Description
Boolean

false

true, to pass the appointment's PersistentObject.Id value to the mapped field in the data source; otherwise, false.

Remarks

When an appointment is created, the appointment's ID is null. If the Appointment.Id property is not mapped, the property always returns null. This does not indicate any problem, because an appointment object uses internal methods to retrieve its unique identifier from the data source.

If the Appointment.Id mapping (AppointmentMappingInfo.AppointmentId property) is specified and the CommitIdToDataSource property is set to true, the scheduler attempts to save an identifier of the newly created appointment back to the data store. Set the CommitIdToDataSource property to true if the appointment identifier PersistentObject.Id value is generated in the application code and should be stored in the bound data source.

Otherwise, you can set the CommitIdToDataSource property to false and set the AppointmentStorage.AutoRetrieveId property to true to automatically retrieve the Id value from the data adapter and assign it to the Appointment.ID property of the newly created appointment. Set the CommitIdToDataSource property to false if the data source utilizes an auto incremented appointment Id column (or values for this column are generated by the data source and not within the application code).

TIP

When implementing the Gantt View, set the CommitIdToDataSource to false, since Gantt view requires an auto incremented ID field.

IMPORTANT

This API is intended to be used with the legacy SchedulerStorage only. Starting with version 18.1, SchedulerStorage and all of its satellite storages are replaced with their updated versions.

See Also