This is in a year view
How can i define an holiday within calendar. When i take mouse cursor over that date holiday should be displayed.
How can i select multiple days and define holidays ? Say for. ex i want to select all Sat and Sun and define them as a weekend. Is this possible at once.
Holidays are similar to appointments, and are added by adding a member to the UltraCalendarInfo.Holidays collection. There is no intrinsic support for "...mouse cursor over that date holiday should be displayed.", although you could use the IUIElementCreationFilter to achieve this.
Multiple-day selection is controlled by the UltraCalendarInfo.SelectTypeDay property. I'm not sure what context the word "select" should be taken in here, however, because you state that you want to "...select all Sat and Sun and define them as a weekend", but those days are already designated as weekend days. If you can, please repost with clarification on exactly what you are trying to accomplish and we can try to help.
No my requirment is little different
I need to define weekends it could be any of the days ... Sat-Sun, Mon-Tue So i am looking if i click on day header Say Sun so all sundays in a sequence for the month should get selected or may be if its possible that Sun of next month which is position below also get selected. Also if this possible to have them selected programmatically. Which property i should use?
Also, It will be great help if you can send me any code sample of defining holidays.
UltraCalendarInfo does not support a notion of a selected day of the week. See below for code to select a a given day of the week for the current month, using the SelectedDateRanges collection:
private void SelectDayOfWeek( UltraCalendarInfo calendarInfo, System.DayOfWeek dayOfWeek, DateTime date ){ calendarInfo.SelectedDateRanges.Clear();
date = new DateTime( date.Year, date.Month, 1 ); int month = date.Month; while ( date.Month == month ) { if ( date.DayOfWeek != dayOfWeek ) { date = date.AddDays( 1 ); continue; }
calendarInfo.SelectedDateRanges.Add( date ); date = date.AddDays( 7 ); }}
To add a holiday for (for example) the first day of the year, add a member to the Holidays collection:UltraCalendarInfo calendarInfo = this.ultraMonthViewSingle.CalendarInfo;calendarInfo.Holidays.Add( new DateTime(DateTime.Today.Year, 1, 1), "New Year's Day" );