Retrieve an appointment by ID

2 posts, 0 answers
  1. Datamex
    Datamex avatar
    161 posts
    Member since:
    Jun 2012

    Posted 07 Aug 2009 Link to this post

    Hello,

    When I follow this Drag and Drop example, I'd like to also use the contextmenu on the RadGrid to add, edit or delete an appointment. I've already managed to get the add and edit-part working, but how do I delete an appointment this way?! Would it be possible to delete an appointment by ID?

    function contextMenuItemClicked(sender, args) { 
          var action = args.get_item().get_value(); 
          var radGridClickedRowIndex = document.getElementById("radGridClickedRowIndex").value; 
          var grid = $find('<%= UnscheduledGrid.ClientID %>'); 
          var masterTableView = grid.MasterTableView; 
          var row = masterTableView.get_dataItems()[radGridClickedRowIndex]; 
          var cell = masterTableView.getCellByColumnUniqueName(row, "AppointmentID"); 
     
          if (action == "Add") { 
            NewUnscheduledAppointment(); 
          } 
          if (action == "Edit") { 
            ShowAppointment(cell.innerHTML); 
          } 
          if (action == "Delete") { 
     
            //How to delete an appointment by ID?! 
          } 
        } 

  2. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 07 Aug 2009 Link to this post

    Hello,

    First, you find the appointment by ID and then use the DeleteAppointment method:

    Appointment a = RadScheduler1.Appointments.FindByID(11);  
    RadScheduler1.DeleteAppointment(a, true); 


    Kind regards,
    Peter
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top