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.
Hi,
I`m not sure that I understand your scenario, but there are few possible approaches to solve this task. Could you please take a look in our online documentation :
http://help.infragistics.com/Help/NetAdvantage/WinForms/2011.2/CLR2.0/html/WinCalendarInfo.html
http://help.infragistics.com/Help/NetAdvantage/WinForms/2011.2/CLR2.0/html/WinCalendarInfo_Save_and_Load_Appointments.html
http://help.infragistics.com/Help/NetAdvantage/WinForms/2011.2/CLR2.0/html/WinGanttView_DataBinding_Support_for_WinGanttView.html
Also please take a look at that forum thread (http://forums.infragistics.com/forums/t/66611.aspx ) where I discuss something similar. There are two samples where I`m using Table Adapters and EntityDataModel to Save/ Load data from/to database.
Let me know if you think that I misunderstood your question, or if you have any further questions.
Regards
hi Georg,
I have calendar control which shows day.month and year view. When the user double clicks on the day, the custom Appointment Dialog is shown where the user can enter the appointment's information and also other extra information like UserName of the those who created the appointment. When the user clicks on "Save&Close" from the dialog, the informations are stored in the table. The ultracalendar info is binded from the stored procedure. Recently we have added the "recurrence" button in our custom appointment dialog. While clicking on this button, it launches the Custom Recurrence Dialog and the recurrence pattern is chosen. This custom dialogs are similar to the ones that are provided in the samples. The recurring appointments are created and saved in the database too. When the user opens the recurring appointment, the recurring edit dialog is shown to know if the user wants to open the occurrence or series. When the user opens it as the occurence, and modifies it, then I need to save this info to the database. How do i save this information in the database after my appointment dialog closes?
Thank you for your reply.
Santosh
Hello Santosh,
Have you been able to resolve your issue ? 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,
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
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.
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.