This is a migrated thread and some comments may be shown as answers.

Exception changing to month view

2 Answers 88 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Scott
Top achievements
Rank 1
Scott asked on 13 Jun 2011, 06:50 PM
If I switch my ScheduleView to the Month view but I have not setup any Appointments I get the below exception. I wouldn't have noticed this but I created a converter that is bound to the ActiveViewDefinition and when switching to Month View my converter does not get called. I Have extended the Appointment class to add a few properties. I'm using 2011 SP1.

System.Windows.Data Error: ConvertBack cannot convert value '1' (type 'System.Int32'). BindingExpression: Path='ActiveViewDefinitionIndex' DataItem='Telerik.Windows.Controls.RadScheduleView' (HashCode=2629102); target element is 'System.Windows.Controls.ListBox' (Name='ViewModeSelection'); target property is 'SelectedIndex' (type 'System.Int32').. System.ArgumentOutOfRangeException: The added or subtracted value results in an un-representable DateTime.

Parameter name: value

at System.DateTime.Subtract(TimeSpan value)

at Telerik.Windows.Controls.ScheduleView.CalendarHelper.GetFirstDayOfWeek(DateTime dateTime, DayOfWeek weekStart)

at Telerik.Windows.Controls.MonthViewDefinition.GetVisibleRangeStart(DateTime dateTime, CultureInfo culture, Nullable`1 firstDayOfWeek)

at Telerik.Windows.Controls.ViewDefinitionBase.GetVisibleRange(DateTime currentDate, CultureInfo culture, Nullable`1 firstDayOfWeek)

at Telerik.Windows.Controls.ScheduleViewBase.GetVisibleRange()

at Telerik.Windows.Controls.ScheduleViewBase.UpdateVisibleRange()

at Telerik.Windows.Controls.RadScheduleView.UpdateVisibleRange()

at Telerik.Windows.Controls.ScheduleViewBase.UpdatePropertiesDependantOnViewDefinition()

at Telerik.Windows.Controls.ScheduleViewBase.OnActiveViewDefinitionChanged(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_ActiveViewDefinition(ViewDefinitionBase value)

at Telerik.Windows.Controls.RadScheduleView.UpdateActiveViewDefinition()

at Telerik.Windows.Controls.RadScheduleView.OnActiveViewDefinitionIndexChanged(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.DependencyPropertyListener.set_Value(Object value)

at System.Windows.PropertyAccessPathStep.set_Value(Object value)

at System.Windows.Data.BindingExpression.UpdateValue().

2 Answers, 1 is accepted

Sort by
0
Rosi
Telerik team
answered on 14 Jun 2011, 07:40 AM
Hello Scott,

We are not able to reproduce the issue at our side. Is it possible to send us your application to test it locally or a sample running project that illustrates the error? We will really appreciate this as it will help us a lot in finding the source of the problem and fix it.

All the best,
Rosi
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Sandi Markon
Top achievements
Rank 1
answered on 28 May 2012, 10:30 AM
Hello, everybody.

I managed to reproduce the same exception by use of your RadScheduleView "Binding To Database" Example (Silverlight version), found here.
I followed the instructions regarding the creation of the database and the required alterations in the Web.config file (setting the correct connection string, both for ScheduleViewEntities and ScheduleViewDBEntities)
Given today's date (28th May 2012), i added a recurring appointment (every day 5 of every second month). After adding the appointment, i switched to "month view" and as i wanted to flip over to July 2012, the beforementioned exception was raised and the application froze.

Of course, the problem was with my current version of the RadControls. I updated from Q1 2011 to the latest version and voila, the exception ceased from occurring.

When using an outdated version of RadControls, I also noticed a little glitch. When creating a new appointment and immediately trying to add a recurrence rule (via the "Edit Recurrence" button), first time in, the recurrence rule is NOT created. Clicking "OK" on the appointment creation dialog creates the appointment, but not the recurrence rule (the column value of "RecurrencePattern" in the "SqlAppointment" table is NULL). When i open the same appointment and again, set the recurrence rule, everything works fine.

Hope it helps anyone, struggling for a solution. The described problems are solved by updating to the latest version of RadControls (in my case, Silverlight; have not tried it in WPF).
Tags
ScheduleView
Asked by
Scott
Top achievements
Rank 1
Answers by
Rosi
Telerik team
Sandi Markon
Top achievements
Rank 1
Share this question
or