Hi,
I have got a scheduler control, which scrolls to work hours perfectly well when the view is changed (Day, Week). However, when the "ShowWeekend" check box is toggled, the scroll to work time does not work.
The code:
Interestingly, if the scheduler is "Grouped by resources" mode (determined by RadRadioButtonGroup.ToggleState), then the scrolling works as required. If it is in normal mode (where RadRadioButtonGroup.ToggleState <> ToggleState.On), scrolling does not work, and the scheduler view starts at 2 AM. Working hours are being determined by options - and the work time is being specified correctly from options (8 AM to 5 PM).
BTW, what does "AutoScrollToWorkTime" do? I did not have it before, but it doesn't seem to make any difference.
Similar code is being used in ActiveViewChanged event of the scheduler control.
Also, I am working with Telerik WinForms version Q1 2011 (and VS 2010). As far as I remember, the code worked before the controls were upgraded from version Q2 2010 SP1. But I could be wrong.
Regards.
I have got a scheduler control, which scrolls to work hours perfectly well when the view is changed (Day, Week). However, when the "ShowWeekend" check box is toggled, the scroll to work time does not work.
The code:
Private
Sub
radSchedulerAppointmentsNavigator_ShowWeekendStateChanged(
ByVal
sender
As
Object
,
ByVal
args
As
Telerik.WinControls.UI.StateChangedEventArgs)
Handles
radSchedulerAppointmentsNavigator.ShowWeekendStateChanged
If
TryCast(
Me
.radSchedulerAppointments.ActiveView, SchedulerMonthView)
Is
Nothing
Then
TryCast(
Me
.radSchedulerAppointments.ActiveView, SchedulerDayViewBase).RulerWidth = 43
TryCast(
Me
.radSchedulerAppointments.ActiveView, SchedulerDayViewBase).DayCount = 1
TryCast(
Me
.radSchedulerAppointments.ActiveView, SchedulerDayViewBase).AutoScrollToWorkTime =
True
Dim
dtStart
As
DateTime = DateTime.Parse(GetOptionValue(
"WORKINGHOURS"
,
"Start"
))
Dim
tsStart
As
New
TimeSpan(dtStart.Hour, dtStart.Minute, 0)
Dim
dtEnd
As
DateTime = DateTime.Parse(GetOptionValue(
"WORKINGHOURS"
,
"End"
))
Dim
tsEnd
As
New
TimeSpan(dtEnd.Hour, dtStart.Minute, 0)
TryCast(
Me
.radSchedulerAppointments.ActiveView, SchedulerDayViewBase).WorkTime =
New
TimeInterval(tsStart, tsEnd)
If
RadRadioButtonGroup.ToggleState = Enumerations.ToggleState.
On
Then
TryCast(
Me
.radSchedulerAppointments.SchedulerElement.ViewElement, SchedulerDayViewGroupedByResourceElement).ScrollToWorkHours()
Else
TryCast(
Me
.radSchedulerAppointments.ActiveView, SchedulerDayViewBase).RulerWidth = 45
TryCast(
Me
.radSchedulerAppointments.SchedulerElement.ViewElement, SchedulerDayViewElement).DataAreaElement.ScrollView.Value = Point.Empty
TryCast(
Me
.radSchedulerAppointments.SchedulerElement.ViewElement, SchedulerDayViewElement).DataAreaElement.Table.ScrollToWorkHours()
End
If
End
If
End
Sub
Interestingly, if the scheduler is "Grouped by resources" mode (determined by RadRadioButtonGroup.ToggleState), then the scrolling works as required. If it is in normal mode (where RadRadioButtonGroup.ToggleState <> ToggleState.On), scrolling does not work, and the scheduler view starts at 2 AM. Working hours are being determined by options - and the work time is being specified correctly from options (8 AM to 5 PM).
BTW, what does "AutoScrollToWorkTime" do? I did not have it before, but it doesn't seem to make any difference.
Similar code is being used in ActiveViewChanged event of the scheduler control.
Also, I am working with Telerik WinForms version Q1 2011 (and VS 2010). As far as I remember, the code worked before the controls were upgraded from version Q2 2010 SP1. But I could be wrong.
Regards.