Back to Devexpress

SchedulerStorageBase.BeginUpdate() Method

corelibraries-devexpress-dot-xtrascheduler-dot-schedulerstoragebase-c8f1181f.md

latest5.5 KB
Original Source

SchedulerStorageBase.BeginUpdate() Method

Locks the object until the EndUpdate or CancelUpdate method is called.

Namespace : DevExpress.XtraScheduler

Assembly : DevExpress.XtraScheduler.v25.2.Core.Desktop.dll

NuGet Package : DevExpress.Scheduler.CoreDesktop

Declaration

csharp
public void BeginUpdate()
vb
Public Sub BeginUpdate

Remarks

Call the BeginUpdate method to maintain performance while applying multiple modifications to the object. After the BeginUpdate method the IsUpdateLocked property returns false to prevent other processes from modifying the object or retrieving its properties. After applying all modifications, call the EndUpdate or CancelUpdate method to finalize the update or cancel it.

Each call to BeginUpdate must be paired with a call to EndUpdate or CancelUpdate. To ensure that EndUpdate / CancelUpdate is always called even if an exception occurs, enclose them in the try…finally statement.

Important

In DevExpress versions prior to 18.1, calling the BeginUpdate method caused the storage to reload its item collection from a data source. Starting with version 18.1, this behavior has been changed and items are not reloaded until the SchedulerStorageBase.EndUpdate is called.

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

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.

how-to-initialize-appointment-images-and-display-text-using-the-custom-field-values-t328320/CS/CustomAppointmentImageAndText/Form1.cs#L33

csharp
schedulerStorage1.BeginUpdate();
try {

winforms-scheduler-recurrence-series-occurrencecalculator/CS/OccurrenceCalculatorSample/Form1.cs#L48

csharp
// Create normal appointments in place of occurrences.
schedulerStorage1.BeginUpdate();
for (int i = 0; i < calculatedOccurrences.Count; i++) {

winforms-scheduler-print-appointments-using-reports/CS/PrintingViaReports/Form1.cs#L113

csharp
ResourceCollection resources = storage.Resources.Items;
storage.BeginUpdate();
try

how-to-initialize-appointment-images-and-display-text-using-the-custom-field-values-t328320/VB/CustomAppointmentImageAndText/Form1.vb#L34

vb
InitAppointments()
schedulerStorage1.BeginUpdate()
Try

winforms-scheduler-recurrence-series-occurrencecalculator/VB/OccurrenceCalculatorSample/Form1.vb#L45

vb
' Create normal appointments in place of occurrences.
schedulerStorage1.BeginUpdate()
For i As Integer = 0 To calculatedOccurrences.Count - 1

winforms-scheduler-print-appointments-using-reports/VB/PrintingViaReports/Form1.vb#L104

vb
Dim resources As ResourceCollection = storage.Resources.Items
storage.BeginUpdate()
Try

winforms-scheduler-import-google-calendar/VB/GoogleCalendarExample/Form1.vb#L67

vb
Me.schedulerStorage1.Appointments.Items.Clear()
Me.schedulerStorage1.BeginUpdate()
Try

See Also

EndUpdate()

CancelUpdate()

IsUpdateLocked

SchedulerStorageBase Class

SchedulerStorageBase Members

DevExpress.XtraScheduler Namespace