I application need to display a foreign calender which have different weekend days (Friday and Saturday rather than Saturday and Sunday) also I should be able to set holidays which occurs every year on same day like Christmas day 25th of December and regular holidays. I am thinking to using the ultraMonthViewSingle to display the month and using ultraCalendarInfo and ultraCalendarLook to control the settings. I have no requirement to add appointment, this is very simple calender display can someone please suggest is this the right choice of controls for the application and how to accomplish the above goals.
Q)How to set different weekend days?
Q)How to set recurring holidays (e.g. Christmas day)
Q) Disable appointment etc. from the control as I am displaying just the calendar
Q) Set the background color of Holiday day date
Q)Bind the holidays collection from Database
dverma said:Q)How to set different weekend days?
ultraCalendarInfo1.DaysOfWeek[DayOfWeek.Thursday].IsWorkDay = false;
ultraCalendarInfo1.DaysOfWeek[DayOfWeek.Friday].IsWorkDay = false;
ultraCalendarInfo1.FirstDayOfWeek = Infragistics.Win.UltraWinSchedule.FirstDayOfWeek.Saturday;
ultraCalendarLook1.DaysOfWeekLook[Infragistics.Win.UltraWinSchedule.DayOfWeekEnum.Thursday].Appearance.BackColor = Color.Red;
ultraCalendarLook1.DaysOfWeekLook[Infragistics.Win.UltraWinSchedule.DayOfWeekEnum.Friday].Appearance.BackColor = Color.Red;
dverma said:Q)How to set recurring holidays (e.g. Christmas day)
ultraCalendarInfo1.Holidays.Add(Convert.ToDateTime("24/12/2012"), "Christmas holiday");
ultraCalendarInfo1.Holidays.Add(Convert.ToDateTime("25/12/2012"), "Christmas holiday");
ultraCalendarLook1.HolidayAppearance.BackColor = Color.Yellow;
dverma said:Q) Disable appointment etc. from the control as I am displaying just the calendar
You could set property AutoAppointmentDialog = false or you could handle
ultraCalendarInfo1_BeforeAppointmentAdded() event and include the code:
private void ultraCalendarInfo1_BeforeAppointmentAdded(object sender, Infragistics.Win.UltraWinSchedule.CancelableAppointmentEventArgs e)
{
e.Cancel = true;
}
dverma said:Q) Set the background color of Holiday day date
dverma said:Q)Bind the holidays collection from Database
You could used
ultraCalendarInfo1.DataBindingsForAppointments
Please take a look in our online documentation. There are similar sample: http://help.infragistics.com/Help/NetAdvantage/WinForms/2011.2/CLR2.0/html/WinGanttView_DataBinding_Support_for_WinGanttView.html
also you could take a look in our sample browser. There are sample "Appointments" under "Calendar and scheduling"
Let me know if you have any questions