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

Delete Appointment using "OnAppointmentDelete"

3 Answers 148 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Anele
Top achievements
Rank 1
Anele asked on 10 Oct 2011, 10:17 PM
Hi

Been trying to deleet an appointment, below is my back code for attempting to delete the appointment

 

 

public void rsAppointments_AppointmentDelete(object sender, SchedulerCancelEventArgs e)

 

{

 

systemBusinessLayer.deleteAppointment(

 

Convert.ToInt32(e.Appointment.ID));

 

}



When i put a brake point I see it doesnt even come near the event.

below is the code from my businesLayer

public

 

 

void deleteAppointment(int appointmentID)

 

{

 

 

using (SqlConnection con = new SqlConnection(ConnString))

 

{

 

 

SqlCommand cmd = new SqlCommand("procDeleteAppointment", con);

 

cmd.CommandType =

 

CommandType.StoredProcedure;

 

cmd.Parameters.Add(

 

new SqlParameter("@appointmentID", SqlDbType.Int));

 

cmd.Parameters[

 

"@appointmentID"].Value = appointmentID;

 

 

 

try

 

{

con.Open();

cmd.ExecuteNonQuery();

}

 

 

catch (SqlException exp)

 

{

 

 

throw new ApplicationException(exp.Message);

 

}

}

}

 


3 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 11 Oct 2011, 12:32 PM
Hello Anele,

You can review how the Delete event is handled in the code behind of the Binding to Generic List demo .

Hope this will be helpful.

Greetings,
Plamen Zdravkov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Anele
Top achievements
Rank 1
answered on 11 Oct 2011, 05:39 PM
Hello sir...

Hei what in god's name is hapening to ma scheduler??When i double click in my appointment so i can update it.Its not opening the modal. check my markup
 below.

<

 

 

telerik:RadScheduler ID="RadScheduler1" DataEndField="EndDate"

 

DataKeyField

 

 

="AppointmentId" DataStartField="StartDate" DataSubjectField="Appoitment_Descr"

 

onappointmentcreated

 

 

="RadScheduler1_AppointmentCreated"

 

ondatabound

 

 

="RadScheduler1_DataBound"

 

 

 

OnAppointmentInsert="rsAppointments_AppointmentInsert"

 

 

 

OnAppointmentDelete="rsAppointments_AppointmentDelete" AllowDelete="true" AllowEdit="true"

 

 

 

OnAppointmentUpdate="rsAppointments_AppointmentUpdate" runat="server"

 

 

 

Width="763px"

 

 

 

FirstDayOfWeek="Monday" LastDayOfWeek="Friday" Skin="Office2007">

 

 

 

<AdvancedForm DateFormat="d/M/yyyy" Modal="True"

 

 

 

EnableCustomAttributeEditing="True" />

 

 

 

</telerik:RadScheduler>

 

0
Plamen
Telerik team
answered on 14 Oct 2011, 03:42 PM
Hi Anele,

I inspected the mark up but there is nothing unusual in it. It looks like the problem is in the code behind. The demo is working as well so you can compare your code with the working code there.

Kind regards,
Plamen Zdravkov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Scheduler
Asked by
Anele
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Anele
Top achievements
Rank 1
Share this question
or