How to Delete the Appointment from the AdvancedEdit Form

2 posts, 0 answers
  1. Rommel
    Rommel avatar
    2 posts
    Member since:
    Dec 2014

    Posted 08 Jan 2015 Link to this post

    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 
  2. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    1746 posts

    Posted 13 Jan 2015 Link to this post

    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.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top