Exception changing to month view

3 posts, 0 answers
  1. Scott
    Scott avatar
    66 posts
    Member since:
    Nov 2009

    Posted 13 Jun 2011 Link to this post

    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. Rosi
    Admin
    Rosi avatar
    2527 posts

    Posted 14 Jun 2011 Link to this post

    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
  3. DevCraft banner
  4. Sandi Markon
    Sandi Markon avatar
    101 posts
    Member since:
    Jul 2012

    Posted 28 May 2012 Link to this post

    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).
Back to Top