Hi.
I have a problem with the ScheduleView. When changing the view from Month to Day, i get a NullReferenceException.
I've attached a sample.
Steps to reproduce the problem :
* run the sample
* expand the cell filled with data
* switch the view to Day
I get a NullReferenceException at that point.
The stack trace is :
The xaml i used is :
the code-behind is :
I used the 2012.2.607.40 version of the library with .Net Framework 4.0.
I have a problem with the ScheduleView. When changing the view from Month to Day, i get a NullReferenceException.
I've attached a sample.
Steps to reproduce the problem :
* run the sample
* expand the cell filled with data
* switch the view to Day
I get a NullReferenceException at that point.
The stack trace is :
at Telerik.Windows.Controls.GroupHeader.InitializeColumnsAndUpdateMaxIntersectedAppointmentsCount()
at Telerik.Windows.Controls.GroupHeader.Initialize()
at Telerik.Windows.Controls.AppointmentsPanel.AddHeaders(GroupHeader header, Boolean isHorizontal, Boolean showWeekHeaders, Calendar calendar, CalendarWeekRule weekRule, DayOfWeek firstDayOfWeek)
at Telerik.Windows.Controls.AppointmentsPanel.MeasureOverride(Size availableSize)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
(...)
The xaml i used is :
<
Window
x:Class
=
"scheduleViewError.MainWindow"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
xmlns:scheduleView
=
"clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.ScheduleView"
Title
=
"MainWindow"
Height
=
"350"
Width
=
"525"
>
<
Grid
>
<
telerik:RadScheduleView
x:Name
=
"scheduleview"
Grid.Row
=
"2"
Grid.Column
=
"2"
Margin
=
"0"
AppointmentsSource
=
"{Binding Appointments}"
BorderThickness
=
"0 1 1 1"
FirstVisibleTime
=
"06:00"
>
<
telerik:RadScheduleView.ViewDefinitions
>
<
telerik:MonthViewDefinition
/>
<
telerik:DayViewDefinition
/>
</
telerik:RadScheduleView.ViewDefinitions
>
</
telerik:RadScheduleView
>
</
Grid
>
</
Window
>
the code-behind is :
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
this.DataContext = new ViewModel();
}
}
public class ViewModel
{
private ObservableAppointmentCollection _apppointments;
public ViewModel()
{
var today = DateTime.Today;
var x = new ObservableCollection<
Appointment
>(Enumerable.Range(9, 14).Select(i =>
new Appointment
{
Start = today.AddMinutes(i * 60 + 15),
End = today.AddMinutes((i + 1) * 60),
Subject = string.Format("Appointment num. {0}", i),
}));
_apppointments = new ObservableAppointmentCollection();
_apppointments.AddRange(x);
}
public ObservableAppointmentCollection Appointments
{
get
{
return _apppointments;
}
set
{
if (_apppointments == value)
return;
_apppointments = value;
}
}
}
I used the 2012.2.607.40 version of the library with .Net Framework 4.0.