This is a migrated thread and some comments may be shown as answers.

How to Delete the Appointment from the AdvancedEdit Form

1 Answer 78 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Rommel
Top achievements
Rank 1
Rommel asked on 08 Jan 2015, 08:29 PM
Good day.   

I want to delete the Appointment inside the AdvancedEditForm of RadScheduler. So I added a Button in the form with the following attributes. 

<asp:Button ID="btnDeleteShift" runat="server" Text="Delete " Enabled="true" CommandName ="Delete" OnClientClick="return confirm('Are you sure you want to delete this appointment?')" OnClick="btnDeleteShift_Click" CausesValidation="false" />

 So when the User clicks OK in the javascript confirmation box, I will execute the code to delete: 

protected void RadScheduler1_AppointmentCommand(object sender, AppointmentCommandEventArgs e) { if (e.CommandName == "Delete") {  RadScheduler1.DeleteAppointment(e.Container.Appointment, false);  } }

The Problem with this is that when the appointment is deleted, the advancedEditForm will still be shown on screen with the values of the Appointment that have been deleted.  

1.  What  code should I use that I can execute that closes that advancedEditForm ? I should execute that one under the AppointmentDelete Event.  

2. Or, is there a code of the advanceeditform where can I use the existing Delete Confirmation Message Window of the appointment to be fired when I click My custom button, then afterwards closes the AdvancedEditForm?  

3. Or, is there a built in Delete function of the AdvanceEditForm to show a delete button and provides the delete functionality?

From what I see, the appointment can be deleted only when I click the X button on the appointment in the radscheduler.   

Hoping for your help and support. 
Thank you very much,  
Rommel 

1 Answer, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 13 Jan 2015, 12:48 PM
Hello Rommel,

I tried the provided code and it works fine after I set the delete button CausesValidation="true". Other solution is to close the advanced form explicitly the advanced form on the server:
//code behind
RadScheduler1.HideEditForm()

or on the client-side
//JavaScript
 
scheduler.hideAdvancedForm();


Regards,
Boyan Dimitrov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Scheduler
Asked by
Rommel
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Share this question
or