Hi Team,
We are currently using the Telerik RadScheduler control in our ASP.NET Web Forms application. As part of a new requirement, we need to enable drag-and-drop functionality to move appointments between resources.
During this drag-and-drop operation, we would like to display a confirmation dialog with OK and Cancel buttons:
If the user clicks OK, the appointment move should proceed.
If the user clicks Cancel, the move should be cancelled without any changes.
We attempted to use radconfirm() within the OnClientAppointmentMoveEnd event to achieve a confirmation dialog similar to the native JavaScript confirm() function. However, we were unable to achieve the expected behavior.
Specifically, when handling the user response and attempting to proceed with the move via scheduler.moveAppointment(appointment, targetSlot);, we encountered the following error:
Uncaught TypeError: Cannot read properties of undefined (reading 'get_index')
Code tried:
function onAppointmentMoveEnd(sender, eventArgs) {
var appointment = eventArgs.get_appointment();
var targetSlot = eventArgs.get_targetSlot();
var scheduler = sender;
// Cancel the automatic move until user confirms
eventArgs.set_cancel(true);
radconfirm("Are you sure you want to move this appointment?", function (userConfirmed) {
if (userConfirmed) {
eventArgs.set_cancel(false);
// Manually perform the move
scheduler.moveAppointment(appointment, targetSlot);
}
// else: Do nothing (cancelled)
{
eventArgs.set_cancel(true);
}
}, 300, 150, null, "Confirm Move");
}
Could you please suggest the recommended approach to implement this behavior effectively with code samples or reference link ?
We appreciate your guidance on this.
Thanks
Sathyendranath.