So I have a custom context menu item I added to the right click menu of the appointments. My client has several recurring appoints they put on their schedule as placeholders that they want to then later be able to assign customers to. Easy enough on a non-recurring appointment like so:
if (e.MenuItem.Value == "CommandSelectClient") {
Response.Redirect("browse_clients.aspx?go=appointments.aspx&m=select&appointment_id=" + e.Appointment.ID.ToString());
}
But, the problem comes when I try do it on a recurring event which is the whole point of this exercise. It passes the recurring event ID through the above URL.
How can I convert the recurring appointment to a non-recurring appointment in this event handler, and then get the non recurring ID passed across to my new page?
Thanks!
11 Answers, 1 is accepted

The recurrence rule is stored in a single appointment (especially useful when you have to deal with abstractions such as infinity). In order to pass a unique identifier for any appointment to your other page, you can still pass the AppointmentId, but in combination with the StartTime of the appointment.
Regards,
Nikolay Tsenkov
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

When I pass the appointment ID of a recurring appointment, it's coming across in a strange format, IE, 607_0, instead of just 607. I need to drop the recurrence rule when the command is executed and only get the single appointment ID (IE, 607)
Thoughts?

You can split the string and get just the first returned item. Something like the following:
// this should get '607' out of '607_0', and at the
// same
time it should get '607' out of '607'
string
aptID = receivedAptID.Split(
'_'
)[0];
Regards,
Nikolay Tsenkov
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

IE, if I have a recurring appointment that goes every day at 10AM, I would want to make tuesday's into a regular appointment using the right click menu item I talked about below.
You can turn the occurrence in a separate appointment if you make it as exception to the recurrence rule of the RecurrenceMaster appointment.
You can achieve this using the following:
// with this method a RecurrenceException appointment is created
var apt = RadScheduler1.PrepareToEdit(occurence,
false
);
//... any editing of the appointment goes here
// for example you can edit the subject: apt.Subject = apt.Subject + " x";
//...
// here the RecurrenceException is being added to the recurrence rule
// and an actual appointment is created and saved in the source
RadScheduler1.UpdateAppointment(apt);
Regards,
Nikolay Tsenkov
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.


Appointment a = radAppointmentsDoctors.PrepareToEdit(e.Appointment, false);
radAppointmentsDoctors.UpdateAppointment(a);
But I can't seem to get the new ID number without re-databinding the schedule. Can you advise how I can get a handle on the new ID number?

In the meantime, I made a "get new id" function that gets the MAX(id) From the appointments table, which in a "quiet" application will be ok, but in a busy office, that isn't safe.
CURRENT SOLUTION:
if (e.MenuItem.Value == "CommandSelectClient") {
Appointment a = radAppointmentsDoctors.PrepareToEdit(e.Appointment, false);
radAppointmentsDoctors.UpdateAppointment(a, e.Appointment);
Response.Redirect("browse_clients.aspx?go=appointments.aspx&m=select&appointment_id=" + bvAppointmentDoctor.getNewID());
}
PREFERRED SOLUTION:
if (e.MenuItem.Value == "CommandSelectClient") {
Appointment a = radAppointmentsDoctors.PrepareToEdit(e.Appointment, false);
radAppointmentsDoctors.UpdateAppointment(a, e.Appointment);
// GET NEW ID HERE SOMEHOW!
Response.Redirect("browse_clients.aspx?go=appointments.aspx&m=select&appointment_id=" + new_id);
}
I know if I do a select * on the appointments table right after UpdateAppointment is called, the new ID is there.. but the scheduler isn't aware of it yet.
Thanks for any help
Thank you for sharing your findings with us.
We don't have any ideas for the moment, but if we can think of some workaround, we will follow up and let you know.
Best wishes,
Peter
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.