Currently I have used DayViewDefinition as mentioned below. But user cannot scroll day view to see non working hours.
<
telerik:DayViewDefinition
DayStartTime
=
"08:00"
DayEndTime
=
"17:00"
MajorTickLength
=
"1h"
MinorTickLength
=
"30min"
MaxTimeRulerExtent
=
"700"
MinTimeRulerExtent
=
"700"
/>
20 Answers, 1 is accepted
I suggest you set the FirstVisibleTime property of the view definition instead of
DayStartTime
.Kind regards,
Rosi
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
<
telerik:RadScheduleView
Style
=
"{StaticResource RadScheduleViewStyle1}"
x:Name
=
"calendarView"
ActiveViewDefinitionIndex
=
"2"
AllowDrop
=
"False"
AutomationProperties.AutomationId
=
"OWS_Results_Calendar_SchedulerView"
ShowDialog
=
"calendarView_ShowDialog"
AppointmentSelectionChanged
=
"calendarView_AppointmentSelectionChanged"
FirstVisibleTime
=
"08:00"
>
<
telerik:RadScheduleView.ViewDefinitions
>
<
telerik:DayViewDefinition
MajorTickLength
=
"1h"
MinorTickLength
=
"30min"
MaxTimeRulerExtent
=
"700"
MinTimeRulerExtent
=
"700"
/>
<
telerik:WeekViewDefinition
MajorTickLength
=
"1h"
MinorTickLength
=
"30min"
MaxTimeRulerExtent
=
"700"
MinTimeRulerExtent
=
"700"
/>
<
telerik:MonthViewDefinition
VisibleDays
=
"30"
FirstDayOfWeek
=
"Monday"
/>
</
telerik:RadScheduleView.ViewDefinitions
>
<
telerik:RadScheduleView.DragDropBehavior
>
<
local:CalendarDragDropBehavior
></
local:CalendarDragDropBehavior
>
</
telerik:RadScheduleView.DragDropBehavior
>
</
telerik:RadScheduleView
>
exception:
System.Windows.Markup.XamlParseException occurred
Message=Element is already the child of another element. [Line: 0 Position: 0]
LineNumber=0
LinePosition=0
StackTrace:
at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
at Symantec.EV.Search.Client.WebApp.UserControls.CalendarView.InitializeComponent()
at Symantec.EV.Search.Client.WebApp.UserControls.CalendarView..ctor()
InnerException: System.NullReferenceException
Message=Object reference not set to an instance of an object.
StackTrace:
at Telerik.Windows.Controls.ScheduleView.LogicalScrollingExtensions.Normalize(IGroupIdentifier group, IGroupingConfigurationSettings groupingConfiguration)
at Telerik.Windows.Controls.ScheduleViewBase.UpdatePhysicalScroll()
at Telerik.Windows.Controls.ScheduleViewBase.OnLogicalScrollPositionPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
at Telerik.Windows.PropertyMetadata.<>c__DisplayClass1.<Create>b__0(DependencyObject d, DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object oldValue, Object newValue)
at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet)
at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
at Telerik.Windows.Controls.ScheduleViewBase.set_FirstVisibleTime(TimeSpan value)
InnerException:
There was a bug that is already fixed in our internal build and the SP release that you can find available for download in your account.
Another way to solve the issue is to hook on the Loaded event of RadScheduleView and set the FirstVisibleTime property in its event handler.
Regards,
Rosi
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
I've tested the FirstVisibleTime property and it works as expected at our side. Please note that the view is scrolled to the set time only when there is not enough space, I've attached a short video to demonstrate how it works.
Best wishes,
Yana
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
FirstVisibleTime is not working for me as well. There was a run-time error. After I downloaded 01549RadControls_for_Silverlight4_2011_2_0927_TRIAL_hotfix today. No run-time error now. But the starting time is still 12: 00 am. Nothing changed.
Thanks
Wei
public MainPage(int committeeID)
{
InitializeComponent();
_vm = new MeetingsViewModel(committeeID);
this.DataContext = _vm;
radScheduleView1.FirstVisibleTime = new TimeSpan(7, 0, 0);
}
<
telerik:RadBusyIndicator
IsBusy
=
"{Binding IsLoading}"
>
<
telerik:RadScheduleView
HorizontalAlignment
=
"Left"
AppointmentsSource
=
"{Binding Meetings}"
Name
=
"radScheduleView1"
>
<
telerik:RadScheduleView.ViewDefinitions
>
<
telerik:DayViewDefinition
Title
=
"List"
MaxTimeRulerExtent
=
"700"
MinTimeRulerExtent
=
"700"
MajorTickLength
=
"1h"
MinorTickLength
=
"30min"
/>
</
telerik:RadScheduleView.ViewDefinitions
>
</
telerik:RadScheduleView
>
</
telerik:RadBusyIndicator
>
Can you try setting Height property of the ScheduleView to "400", for example, so that the vertical scrollbar will be shown - is the FirstVisibleTime property applied correctly now?
If this doesn't help, please send us short video (you can use Jing) showing the erroneous behavior. You should open a support ticket and attach it there.
Best wishes,
Yana
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Thanks
Wei
Please find my test project attached.
Hope it helps.
Regards,
Yana
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
It did work running your sample. I found why my code did not work
<
Grid
x:Name
=
"LayoutRoot"
Background
=
"White"
>
<
telerik:RadBusyIndicator
IsBusy
=
"{Binding IsLoading}"
>
<
telerik:RadScheduleView
HorizontalAlignment
=
"Left"
AppointmentsSource
=
"{Binding Meetings}"
Name
=
"radScheduleView1"
>
<
telerik:RadScheduleView.ViewDefinitions
>
<
telerik:DayViewDefinition
MajorTickLength
=
"1h"
MinorTickLength
=
"30min"
/>
</
telerik:RadScheduleView.ViewDefinitions
>
</
telerik:RadScheduleView
>
</
telerik:RadBusyIndicator
>
</
Grid
>
Thanks
Wei
I do not want to set the height of RadScheduleView, it should get displayed in the area available to it. Even in this case say I set FirstVisibleTime to 7:00 AM then in day and week view, time ruler should scroll till 7:00 AM and should show 7:00 AM into view. User should then be able to scroll up and down to see other times. Please do let me know if this is achievable.
Wei: I guess that you're using some service to load the appointments and when FirstVisibleTime property is set, the appointments are not loaded yet. I suggest to set the property after the appointments are loaded in order to workaround it.
Pooja: I've set the height only to explain how the property works - generally it's not needed. As I explained in one of my previous posts, the view is scrolled to the set time only when there is not enough space and a scrollbar is already available.
Greetings,
Yana
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
My silverlight testing project does not load any data. You know what, I tested your sample project by added RadBusyIndicator tag
<
telerik:RadBusyIndicator
IsBusy
=
"{Binding IsLoading}"
>
<
telerik:RadScheduleView
x:Name
=
"scheduleView1"
AppointmentsSource
=
"{Binding Appointments}"
>
<
telerik:RadScheduleView.ViewDefinitions
>
<
telerik:DayViewDefinition
MajorTickLength
=
"1h"
MinorTickLength
=
"30min"
/>
<
telerik:WeekViewDefinition
/>
</
telerik:RadScheduleView.ViewDefinitions
>
</
telerik:RadScheduleView
>
</
telerik:RadBusyIndicator
>
Thanks
Wei
You are right, I was able to observe the issue with the BusyIndicatior. We'll research it, but for now could you please for now set the it in the Loaded event of the RadScheduleView?
private
void
scheduleView_Loaded(
object
sender, RoutedEventArgs e)
{
this
.scheduleView.FirstVisibleTime =
new
TimeSpan(7, 0, 0);
}
Best wishes,
Yana
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
For me FirstVisibleTime is not yet working.
What I am trying to do is, when user comes to Day View , view should scroll to the first appointment in the day. Similarly when user open Week view, view should scroll to first appointment in the week.
For this I am using VisibleRangeChanged event of RadScheduleView. Since the FirstVisibleTime does not work for me I am now using ScrollTimeRuler() method. It works fine except in few cases like:
1. when user switches between Month View and any other view
2. When user clicks on Group Header in month view, it open the week view but does not scroll correctly
if (calendarView.ActiveViewDefinition.GetType() != typeof(MonthViewDefinition))
{
//get the first appointment in the visible date range
CalendarItemVM firstAppointmentOfDay = ((List<
CalendarItemVM
>)calendarView.AppointmentsSource).Where(p => p.Start >= calendarView.VisibleRange.Start
&& p.Start <
calendarView.VisibleRange.End
).OrderBy(o => o.Start).FirstOrDefault();
if (firstAppointmentOfDay != null)
calendarView.ScrollTimeRuler(firstAppointmentOfDay.Start.TimeOfDay, true, true);
else
calendarView.ScrollTimeRuler(new TimeSpan(8, 0, 0), true, true);
}
Any idea if this is a bug.
Could you please try it with a Dispatcher like this:
if
(calendarView.ActiveViewDefinition.GetType() !=
typeof
(MonthViewDefinition))
{
Dispatcher.BeginInvoke(
new
Action(() =>
{
//get the first appointment in the visible date range
CalendarItemVM firstAppointmentOfDay = ((List<CalendarItemVM>)calendarView.AppointmentsSource).Where(p => p.Start >= calendarView.VisibleRange.Start
&& p.Start < calendarView.VisibleRange.End).OrderBy(o => o.Start).FirstOrDefault();
if
(firstAppointmentOfDay !=
null
)
calendarView.ScrollTimeRuler(firstAppointmentOfDay.Start.TimeOfDay,
true
,
true
);
else
calendarView.ScrollTimeRuler(
new
TimeSpan(8, 0, 0),
true
,
true
);
}));
}
It works as expected at our side.
Kind regards,
Yana
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
I haven't yet figured it out.
I tried the same (dispatcher), and it got a little better, since before this workaround it would go to 1am, not it's going to 4am, but the line of code clearly says 8am...
private
void
SchedulerVisibleRangeChanged(
object
sender, EventArgs e)
{
//scroll to position
if
(scheduler.ActiveViewDefinition.GetType() !=
typeof
(MonthViewDefinition))
{
Dispatcher.BeginInvoke(
new
Action(() =>
{
scheduler.ScrollTimeRuler(
new
TimeSpan(8, 0, 0),
true
,
true
);
}));
}
}
I am using WPF by the way, but this post was the one more close to my issue at the moment.
Thanks in advance...
Actually this is an issue in RadScheduleView, we've already logged it, you can vote for it and track its progress here.
Kind regards,
Yana
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.