Hello,
I'm working with an UltraDayView control that allows the user to display numerous appointments for the full work week in two different views: by the single day, or by five days (Friday - Thursday excluding weekends). If the user is currently viewing the multiple day view, I'd like to change the number of days they scroll by when they use the left and right arrow keys on the start and end dates.
For example, if the user has Friday (the first day on the view) selected, and they use the left arrow key to scroll back, I'd like for the UltraDayView to scroll to the previous Friday (7 days). If the user has Thursday (the last day on the view to the right) selected, and they use the right arrow key to scroll forward, I'd like fro the UltraDayView to scroll to the next Thursday (7 days). By default, the UltraDayView appears to scroll in only one day interval.
Does this ability exist on the UltraDayView or UltraCalendarInfo? If not, what event do I need to be looking for in order to customize this action?
Thanks,Melissa
Any follow up on this post yet? I gave up trying to change the scroll interval based on the left and right arrows, and now have the selected date ranges changing when they click a "navigation" button. However, I'd still like to know what logic goes on whenever the left or right arrow key is pressed on the UltraDayView, so I can use this logic to change how the navigation buttons work based on how many days are currently being shown (1 or 5 or 7, based on preferences.)
Could you please review the sample attached to this post and see if it meets your requirements.Please feel free to let me know if I misunderstood you or if you have any other questions.
Thank you for the reply, but I managed to get the desired results by doing the following pieces of code:
If _isSingleDayView Then Dim currentDay = udvSchedule.GetDateAtLogicalColumn(0).Date uciMain.SelectedDateRanges.Clear() uciMain.SelectedDateRanges.Add(currentDay - TimeSpan.FromDays(1)) Else Dim firstDay = udvSchedule.GetDateAtLogicalColumn(0).Date
uciMain.SelectedDateRanges.Clear() uciMain.SelectedDateRanges.Add(firstDay - TimeSpan.FromDays(7), firstDay -TimeSpan.FromDays(1)) Presenter.GetHistoryEntries(firstDay - TimeSpan.FromDays(7), firstDay - TimeSpan.FromDays(1), UserID) udvSchedule.Refresh() End If
I'm keeping track of a global variable based on which "mode" the schedule is in - single day or multiple day. If it's single day, I want to select the day adjacent to the current date. If it's multiple, get the current date and move back 7 days. I used similar logic for the "Next" button.
This works fine
if (Display7Days)
{
uciSchedule.SelectedDateRanges.Add(dtpDate.Value, 6, true);
udvSchedule.GroupingStyle = DayViewGroupingStyle.DateWithinOwner;
}
else
uciSchedule.SelectedDateRanges.Add(dtpDate.Value, 0, true);
udvSchedule.GroupingStyle = DayViewGroupingStyle.OwnerWithinDate;