You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: components/scheduler/editing/edit-appointments.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,9 +32,9 @@ By default, the user can only view the appointments, because creating, updating
32
32
33
33
Main events you need to implement so you can store the appointment information changed or created by the user:
34
34
35
-
*`OnCreate` - fires when the user saves a new appointment, including an exception for a recurring appointment.
36
-
*`OnUpdate` - fires when the user changes an existing appointment. Fires for the recurring appointment when an exception has been created for it.
37
-
*`OnDelete` - fires when the user deletes and appointment (including a recurring appointment). You can also enable a [delete confirmation dialog](#delete-confirmation-dialog).
35
+
*`OnCreate` - fires when the user saves a new appointment, including an exception for a recurring appointment. The event arguments include a `RecurrenceEditMode` property that indicates whether the user is creating an exception to a recurring appointment (`RecurrenceEditMode.Occurrence`) or a new regular appointment.
36
+
*`OnUpdate` - fires when the user changes an existing appointment. Fires for the recurring appointment when an exception has been created for it. The event arguments include a `RecurrenceEditMode` property that indicates whether the user chose to update the entire series (`RecurrenceEditMode.Series`) or only a single occurrence (`RecurrenceEditMode.Occurrence`).
37
+
*`OnDelete` - fires when the user deletes an appointment (including a recurring appointment). You can also enable a [delete confirmation dialog](#delete-confirmation-dialog). The event arguments include a `RecurrenceEditMode` property that indicates whether the user chose to delete the entire series (`RecurrenceEditMode.Series`) or only a single occurrence (`RecurrenceEditMode.Occurrence`).
38
38
39
39
There are two other events that you are not required to handle - you can use them to implement application logic:
40
40
@@ -90,6 +90,8 @@ When the user clicks the close button (`x`) of the appointment a confirmation di
90
90
91
91
The example below shows the signature of the event handlers so you can copy the proper arguments and start implementing your business logic and data storage operations. The example only updates the local collection of appointments used in the UI.
92
92
93
+
>tip The event arguments for `OnCreate`, `OnUpdate`, and `OnDelete` include a `RecurrenceEditMode` property. This property indicates whether the user chose to modify only a single occurrence or the entire series of a recurring appointment. For detailed information and examples, see the [Handling Recurring Appointments in CRUD Events](slug:scheduler-recurrence#handling-recurring-appointments-in-crud-events) section.
>note It is up to the data access logic to save the data once it is changed in the data collection. The example below showcases when that happens and adds some code to provide a visual indication of the change. In a real application, the code for handling data updates may be entirely different.
Copy file name to clipboardExpand all lines: components/scheduler/events.md
+8-1Lines changed: 8 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,14 @@ This article explains the events available in the Telerik Scheduler for Blazor:
24
24
25
25
## CUD Events
26
26
27
-
To implement appointment editing, the scheduler exposes the `OnCreate`, `OnDelete` and `OnUpdate` events. They let you propagate the changes the user makes in the UI to the view model and to the data storage. You can read mode in the [Appointment Editing](slug:scheduler-appointments-edit) article.
27
+
To implement appointment editing, the scheduler exposes the `OnCreate`, `OnDelete` and `OnUpdate` events. They let you propagate the changes the user makes in the UI to the view model and to the data storage. You can read more in the [Appointment Editing](slug:scheduler-appointments-edit) article.
28
+
29
+
The event arguments for these events include a `RecurrenceEditMode` property that indicates the user's choice when editing or deleting recurring appointments:
30
+
31
+
*`RecurrenceEditMode.Series` - The user chose to modify the entire series of recurring appointments.
32
+
*`RecurrenceEditMode.Occurrence` - The user chose to modify only a single occurrence of the recurring appointment.
33
+
34
+
For detailed examples of handling recurring appointments in CRUD events, see the [Handling Recurring Appointments in CRUD Events](slug:scheduler-recurrence#handling-recurring-appointments-in-crud-events) section.
Copy file name to clipboardExpand all lines: components/scheduler/recurrence.md
+158Lines changed: 158 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,7 @@ The Telerik Scheduler for Blazor supports displaying and editing of recurring ap
15
15
* Configure the Scheduler for using recurring appointments.
16
16
* Define recurrence rules and recurrence exceptions in the Scheduler data.
17
17
* Edit recurring appointments and exceptions.
18
+
* Handle editing and deleting recurring appointments with the recurrence context.
18
19
19
20
## Basics
20
21
@@ -219,6 +220,163 @@ A single Scheduler data item defines one series of recurring appointments. Set t
219
220
}
220
221
````
221
222
223
+
## Handling Recurring Appointments in CRUD Events
224
+
225
+
When users edit, update, or delete a recurring appointment, the Scheduler prompts them to choose whether to modify only the current occurrence or the entire series. This choice is reflected in the `RecurrenceEditMode` property of the event arguments.
226
+
227
+
### RecurrenceEditMode Property
228
+
229
+
The `OnCreate`, `OnUpdate`, and `OnDelete` event handlers receive event arguments that include a `RecurrenceEditMode` property. This property indicates the user's choice when interacting with recurring appointments:
230
+
231
+
*`RecurrenceEditMode.Series` - The user chose to edit or delete the entire series of recurring appointments.
232
+
*`RecurrenceEditMode.Occurrence` - The user chose to edit or delete only a single occurrence of the recurring appointment.
233
+
234
+
### Usage in Event Handlers
235
+
236
+
You can use the `RecurrenceEditMode` property to implement different logic based on whether the user is modifying a single occurrence or the entire series.
237
+
238
+
>caption Handle RecurrenceEditMode in OnUpdate and OnDelete events
// This is a recurring appointment, create an exception
349
+
// The Scheduler automatically adds the occurrence date to RecurrenceExceptions
350
+
SchedulerData.Remove(item);
351
+
}
352
+
}
353
+
}
354
+
355
+
public class Appointment
356
+
{
357
+
public Guid Id { get; set; }
358
+
public string Title { get; set; } = string.Empty;
359
+
public DateTime Start { get; set; }
360
+
public DateTime End { get; set; }
361
+
public bool IsAllDay { get; set; }
362
+
public string RecurrenceRule { get; set; } = string.Empty;
363
+
public List<DateTime>? RecurrenceExceptions { get; set; }
364
+
public Guid? RecurrenceId { get; set; }
365
+
366
+
public Appointment()
367
+
{
368
+
Id = Guid.NewGuid();
369
+
}
370
+
}
371
+
}
372
+
````
373
+
374
+
### Important Considerations
375
+
376
+
* When the user edits or deletes a single occurrence of a recurring appointment, the Scheduler automatically manages the `RecurrenceExceptions` list and creates exception appointments with the appropriate `RecurrenceId`.
377
+
* The `RecurrenceEditMode` property is only relevant when working with recurring appointments. For regular (non-recurring) appointments, this property is not used.
378
+
* When creating a new appointment in a time slot that matches a recurring appointment, the user can choose to create an exception or a new independent appointment.
379
+
222
380
## Recurrence Editor Components
223
381
224
382
Telerik UI for Blazor provides standalone components that you can use to edit recurring appointments outside the Scheduler or in a [custom Scheduler popup edit form](slug:scheduler-kb-custom-edit-form).
0 commit comments