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
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ Main events you need to implement so you can store the appointment information c
34
34
35
35
*`OnCreate` - fires when the user saves a new appointment, including an exception for a recurring appointment.
36
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).
37
+
*`OnDelete` - fires when the user deletes an appointment (including a recurring appointment). You can also enable a [delete confirmation dialog](#delete-confirmation-dialog).
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
@@ -45,6 +45,8 @@ There are two other events that you are not required to handle - you can use the
45
45
*`OnEdit` does not fire when the user drags to resize or move appointments, it fires only for the advanced edit form (double clicks on the appointment).
46
46
*`OnCancel` - fires when the user clicks the `Cancel` button in the edit form or the `[x]` close button at the window titlebar to discard the changes they just made to an appointment.
47
47
48
+
The event arguments that are received by the `OnEdit`, `OnUpdate`, and `OnDelete` events include a `EditMode` property that indicates whether the user chose to delete the entire series (`SchedulerRecurrenceEditMode.Series`) or only a single occurrence (`SchedulerRecurrenceEditMode.Occurrence`). For detailed information and examples, 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
+172Lines changed: 172 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,177 @@ 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 `EditMode` property of the event arguments.
226
+
227
+
### RecurrenceEditMode Property
228
+
229
+
The `OnEdit`, `OnUpdate`, and `OnDelete` event handlers receive event arguments that include a `EditMode` property. This property indicates the user's choice when interacting with recurring appointments:
230
+
231
+
*`SchedulerRecurrenceEditMode.Series` - The user chose to edit or delete the entire series of recurring appointments.
232
+
*`SchedulerRecurrenceEditMode.Occurrence` - The user chose to edit or delete only a single occurrence of the recurring appointment.
233
+
234
+
### Example
235
+
236
+
You can use the `EditMode` 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.
363
+
// The Scheduler automatically adds the occurrence date to RecurrenceExceptions.
364
+
SchedulerData.Remove(item);
365
+
}
366
+
}
367
+
}
368
+
369
+
public class Appointment
370
+
{
371
+
public Guid Id { get; set; }
372
+
public string Title { get; set; } = string.Empty;
373
+
public DateTime Start { get; set; }
374
+
public DateTime End { get; set; }
375
+
public bool IsAllDay { get; set; }
376
+
public string RecurrenceRule { get; set; } = string.Empty;
377
+
public List<DateTime>? RecurrenceExceptions { get; set; }
378
+
public Guid? RecurrenceId { get; set; }
379
+
380
+
public Appointment()
381
+
{
382
+
Id = Guid.NewGuid();
383
+
}
384
+
}
385
+
}
386
+
````
387
+
388
+
### Important Considerations
389
+
390
+
* 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`.
391
+
* The `RecurrenceEditMode` property is only relevant when working with recurring appointments. For regular (non-recurring) appointments, this property is not used.
392
+
* 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.
393
+
222
394
## Recurrence Editor Components
223
395
224
396
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