Skip to main content

AppointmentStorage.CommitIdToDataSource Property

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

Namespace: DevExpress.XtraScheduler

Assembly: DevExpress.XtraScheduler.v24.1.dll

NuGet Package: DevExpress.Win.Scheduler

Declaration

[DefaultValue(false)]
public bool CommitIdToDataSource { get; set; }

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.

The following code snippets (auto-collected from DevExpress Examples) contain references to the CommitIdToDataSource property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also