I am using Custom Appointment Dialog and Custom Recurrence Dialog in the application where I have integrated calendar control. I have used the stored procedure for getting the appointments and owners table and then used it to create dataset for binding it to the ultraCalendarInfo. I am saving the appointments in the Appointment Changed event like below:
OutlookAppointmentDialog dlg = new OutlookAppointmentDialog();
dlg.AppointmentChanged += new AppointmentChangedHandler(dlg_OnAppointmentChanged);
dlg.ShowDialog(appointment, this.MainCalendarInfo, this.ultraCalendarLook1, this, appointment.Owner);
void dlg_OnAppointmentChanged(object sender, AppointmentChangedEventArgs e)
{
SaveAppointment(e.Appointment);
}
When I open an existing recurring appointment as occurence and modify it, the recurring appointments gets dissappeared. I found out that when variance are created, a new instance of appointment is created. So, I tried to create new appointment when it is variance. While doing this, I end up getting two appointments in the calendar. Could you please let me know how to save variance without using data bindings?
Thank you for your time.
Hello Santosh,
Maybe you are looking for
private void ultraButton2_Click(object sender, EventArgs e) { Appointment app = new Appointment(DateTime.Today.AddDays(3), DateTime.Today.AddDays(3)); app.Subject = "Test New"; app.Recurrence = new AppointmentRecurrence(); ultraCalendarInfo1.Appointments.Add(app); app.Recurrence.OccurrenceStartTime = ultraCalendarInfo1.Appointments[1].Recurrence.OccurrenceStartTime; app.Recurrence.OccurrenceDuration = ultraCalendarInfo1.Appointments[1].Recurrence.OccurrenceDuration; app.Recurrence.PatternInterval = ultraCalendarInfo1.Appointments[1].Recurrence.PatternInterval; }
private void ultraButton2_Click(object sender, EventArgs e)
Appointment app = new Appointment(DateTime.Today.AddDays(3), DateTime.Today.AddDays(3));
app.Subject = "Test New";
app.Recurrence = new AppointmentRecurrence();
ultraCalendarInfo1.Appointments.Add(app);
app.Recurrence.OccurrenceStartTime = ultraCalendarInfo1.Appointments[1].Recurrence.OccurrenceStartTime;
app.Recurrence.OccurrenceDuration = ultraCalendarInfo1.Appointments[1].Recurrence.OccurrenceDuration;
app.Recurrence.PatternInterval = ultraCalendarInfo1.Appointments[1].Recurrence.PatternInterval;
Please take a look at the attached sample and video file for more details. If you think that I misunderstood your scenario, please feel free to modify this sample tro reproduce your case and revert it back to me. I`ll br glad to research it for you. Let me know if you have any questions.
Regards
Hello Georgi,
I am saving the appointments after the save button is clicked from the custom appointment dialog. When the appointment has variance, I am creating new appointment by copying the info from the old one. but I couldn't reference the variance to the original recurring appointment. . How should I reference the variance with the original recurring appointment?
Thanks for you help.
Santosh
If I understood your scenario, you have custom Appoitment Dialog form. Also you are using UltraCalendarInfo. If so, I suppose that you could handle ButtonClick event of your "Save and Close" button and include the code which store your data in your database. Please take a look in our sample browser that you recieved with installation of our controls. There are similar sample "WinShedule Outlook". Let me know if you have any questions
Hi Georg,
Yes, I am using UltraCalendarInfo in my application. I can see the changes made in the recurring appointment by using dataset's rowchanged event when i added this line
myDataSet.Tables["Appointment"].RowChanged += new DataRowChangeEventHandler(CalendarMain_RowChanged);
This event gets hit multiple times even if i change only the subject of appointment. Anyways, I have to save the appointment when the appointment dialog's save button is clicked and still couldn't figure out the way to save it.
Thanks,
Have you been able to resolve your issue ? Let me know if you have any questions