This is a migrated thread and some comments may be shown as answers.
Retrieve an appointment by ID
1 Answer 20 Views
This is a migrated thread and some comments may be shown as answers.
Datamex
Top achievements
Rank 2
Datamex asked on 07 Aug 2009, 01:35 PM
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?! 
      } 
    } 

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 07 Aug 2009, 03:08 PM
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.
Asked by
Datamex
Top achievements
Rank 2
Answers by
Peter
Telerik team
Share this question
or