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

I can't delete appointment, please help

2 Answers 61 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Admir Brkić
Top achievements
Rank 1
Admir Brkić asked on 07 May 2010, 04:01 PM
I use this code to delete:

 protected void RadScheduler1_AppointmentDelete(object sender, Telerik.Web.UI.SchedulerCancelEventArgs e)
    {
        SchedulerTask task = SchedulerTask.GetByID(Convert.ToInt32(e.Appointment.ID));
        task.Delete();             
     }

And I get next error message:

Server Error in '/src' Application.

No parameterless constructor defined for this object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.MissingMethodException: No parameterless constructor defined for this object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[MissingMethodException: No parameterless constructor defined for this object.]
   Telerik.Web.UI.Scheduling.DataSourceViewSchedulerProvider.OnDataSourceOperationComplete(Int32 count, Exception e) +39
   System.Web.UI.DataSourceView.Delete(IDictionary keys, IDictionary oldValues, DataSourceViewOperationCallback callback) +83
   Telerik.Web.UI.Scheduling.DataSourceViewSchedulerProvider.Delete(RadScheduler owner, Appointment appointmentToDelete) +262
   Telerik.Web.UI.Scheduling.AppointmentController.DeleteAppointmentThroughProvider(Appointment appointmentToDelete) +170
   Telerik.Web.UI.Scheduling.AppointmentController.DeleteAppointment(Appointment appointmentToDelete, Boolean deleteSeries) +1833
   Telerik.Web.UI.RadScheduler.DeleteAppointment(Appointment appointmentToDelete) +109
   Telerik.Web.UI.RadScheduler.ProcessPostBackCommand(SchedulerPostBackEvent postBack) +2427
   Telerik.Web.UI.RadScheduler.RaisePostBackEvent(String eventArgument) +108
   Telerik.Web.UI.RadScheduler.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +42
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +176
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563

2 Answers, 1 is accepted

Sort by
0
Admir Brkić
Top achievements
Rank 1
answered on 07 May 2010, 04:02 PM
I use same for insert appointment and work very well.

 protected void RadScheduler1_AppointmentInsert(object sender, Telerik.Web.UI.SchedulerCancelEventArgs e)
    {
        SchedulerTask task = new SchedulerTask(e.Appointment);
        task.Insert();
             
        
    }

0
Veronica
Telerik team
answered on 10 May 2010, 10:19 AM
Hello Admir Brkić,

It seems that the SchedulerTask class has a method Delete in which you'll have to add some parameters. Please check what papameters are required for the Delete()?

If you still need help - could you please send me the full code so I can inspect it and help you?

Thank you!

Greetings,
Veronica Milcheva
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Scheduler
Asked by
Admir Brkić
Top achievements
Rank 1
Answers by
Admir Brkić
Top achievements
Rank 1
Veronica
Telerik team
Share this question
or