I'm working with a set of UltraWinSchedule appointments and an UltraDayView control that displays the appointments. I'd like to be able to click a "Week View" button that makes the UltraDayView display the current week, with each day having the appointments in their associated timeslots displayed side by side vertically, much like how Microsoft Outlook shows the work week calendar.
I've read other forum posts on this, telling how to clear the SelectedDateRanges property of the CalendarInfo object and then adding a new SelectedDateRange from the week start to the week end, or from the week start for 5 days, using the following code:
When I do this, I get a warning for "Too many days have been selected.". The MaxSelectedDays property on the CalendarInfo object is set well above 5 days. What could be causing this error?
I tried this and it always works fine for me so I attached my sample to this post for you. Please review it and feel free to let me know if I misunderstood you. Also I will be happy to take a look at a small sample project of your own which reproduces this issue.Please do not hesitate to contact us if you need any additional assistance.
Thanks for the reply.. I had set the "SelectTypeDay" on the CalendarInfo object to "Single", so I couldn't select more than one day in the date range to achieve what I mentioned about. Setting this property to "Extended" seems to have fixed the problem.
However, I had previously configured the UltraDayView to not allow editing when single clicking on an appointment, and now it appears that this has been reset. Can you direct me on how to prevent this editing?
I am glad to hear that you were able to resolve the previous issue.
For the current one you could try the following code:
private void ultraDayView1_BeforeAppointmentEdited(object sender, Infragistics.Win.UltraWinSchedule.CancelableAppointmentEventArgs e)
e.Cancel = true;
Please feel free to let me know if I misunderstood you or if you have any other questions.
Yep, that's the information I needed. Thanks again!
The only thing I'm stuck with now is if there's a way to hide weekend days (Saturday and Sunday) from the UltraDayView when there's a date range selected that contains them. For example, if I select Friday through Thursday, I'd like to give the user to option to show or to hide the week end days, since they don't really apply to the "work week". Is this possible?
Could you please try the following code and see if it meets your requirements:
Infragistics.Win.UltraWinSchedule.DayOfWeek dayOfWeek1 = new Infragistics.Win.UltraWinSchedule.DayOfWeek(System.DayOfWeek.Sunday);
Infragistics.Win.UltraWinSchedule.DayOfWeek dayOfWeek2 = new Infragistics.Win.UltraWinSchedule.DayOfWeek(System.DayOfWeek.Saturday);
dayOfWeek1.Enabled = false;
dayOfWeek2.Enabled = false;