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

Calendar crash on UWP when clicking around to change the date

11 Answers 81 Views
Calendar & Scheduling
This is a migrated thread and some comments may be shown as answers.
Valentin
Top achievements
Rank 1
Valentin asked on 22 Aug 2018, 11:29 PM

Hello,

I ran into a scenario where clicking randomly with the mouse to change the date eventually results in a crash. It typically takes 10 or more clicks in relatively fast succession. I was not able to find a specific pattern that causes the crash. However, I can recreate it more reliably when the calendar has MaxDate set.

Here's the crash stack trace:

at System.ThrowHelper.ThrowAddingDuplicateWithKeyArgumentException(Object key)
at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
at Telerik.UI.Xaml.Controls.Input.Calendar.XamlDecorationLayer.GetCalendarDecorationVisual(CalendarNode node, CalendarDecorationType decorationType)
at Telerik.UI.Xaml.Controls.Input.Calendar.XamlDecorationLayer.UpdateCalendarCellDecorations(IEnumerable`1 cellsToUpdate)
at Telerik.UI.Xaml.Controls.Input.Calendar.XamlDecorationLayer.UpdateUI(IEnumerable`1 cellsToUpdate)
at Telerik.UI.Xaml.Controls.Input.RadCalendar.UpdatePresenters(IEnumerable`1 cellsToUpdate)
at Telerik.UI.Xaml.Controls.Input.Calendar.CurrencyService.UpdatePresenters(DateTime oldCurrentDate, DateTime newCurrentDate)
at Telerik.UI.Xaml.Controls.Input.Calendar.CurrencyService.<>c__DisplayClass19_0.<AsyncUpdateCurrencyPresenters>b__0()

 

Here's the code I used:

XAML

<?xml version="1.0" encoding="utf-8" ?>
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="CalendarCrash.MainPage"
             xmlns:telerikInput="clr-namespace:Telerik.XamarinForms.Input;assembly=Telerik.XamarinForms.Input">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="1*"/>
            <RowDefinition Height="1*"/>
        </Grid.RowDefinitions>
 
        <telerikInput:RadCalendar
                HorizontalOptions="CenterAndExpand"
                VerticalOptions="CenterAndExpand"
                x:Name="calendar" />
        <Label Grid.Row="1" Text="Calendar crash"
                HorizontalOptions="CenterAndExpand"
                VerticalOptions="CenterAndExpand" />
    </Grid>
</ContentPage>

 

Code behind:

using System;
using Xamarin.Forms;
 
namespace CalendarCrash
{
    public partial class MainPage : ContentPage
    {
        public MainPage()
        {
            InitializeComponent();
 
            calendar.MaxDate = DateTime.Now;
        }
    }
}

 

 

Could you recommend any workaround or does this require a bug fix on your end?

11 Answers, 1 is accepted

Sort by
0
Valentin
Top achievements
Rank 1
answered on 22 Aug 2018, 11:33 PM
Forgot to mention I'm using the latest update 2018_2_821_1.
0
Didi
Telerik team
answered on 28 Aug 2018, 07:51 AM
Hi Valentin,

Thank you for the provided code.

I have tested the described scenario on UWP but on my side it works fine. I have created a sample example using the latest version of Telerik UI for Xamarin and Xamarin.Forms v3.1.0.697729. Please take a look at the attached sample and let me know if you continue getting those errors.

Looking forward to your reply.

Regards,
Didi
Progress Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Valentin
Top achievements
Rank 1
answered on 28 Aug 2018, 02:39 PM

Hello Didi, thank you for trying to recreate the scenario.

I tried updating to the latest Telerik UI for Xamarin and the latest Xamarin Forms. I can still recreate the scenario fairly easy. I'm running the app on Windows 10 Pro 1803.

I recorded a video to give you an idea about how fast I was clicking around. Unfortunately I cannot attach it here due to the 2MB and content type restrictions. Is there any other way to upload the video?

0
Didi
Telerik team
answered on 31 Aug 2018, 01:15 PM
Hi Valentin,

In the Forum only image attachments are allowed. In this case you can upload the video in web channel and send me a link to it. 

Looking forward to your reply.

Regards,
Didi
Progress Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Valentin
Top achievements
Rank 1
answered on 04 Sep 2018, 06:21 PM
0
Stefan Nenchev
Telerik team
answered on 07 Sep 2018, 09:47 AM
Hi, Valentin,

Thank you for the video. We have managed to replicate the behavior, though it was not that easy to reproduce it on our end. We will need some more time to examine it and provide you with more information. We will update the thread once we have such from our end. In the meantime, your patience is highly appreciated.

Have a great weekend.

Regards,
Stefan Nenchev
Progress Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Stefan Nenchev
Telerik team
answered on 19 Sep 2018, 03:13 PM
Hi, Valentin,

Thank you for your patience.

We have investigated the behavior and managed to apply a fix which should deal with the issue. The fix will be available with the next release so you can test the behavior with the binaries once they are available. Here is the actual bug report, we will change the status of the item once the fix is officially included - Calendar: Switching through the cells throws KeyNotFoundException

If you have any further questions or concerns, do not hesitate to contact us.

Regards,
Stefan Nenchev
Progress Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Accepted
Stefan Nenchev
Telerik team
answered on 19 Sep 2018, 03:23 PM
Hi, Valentin,

Here is the actual bug report for Xamarin, as the previously provided is for the UI for UWP product - Calendar:[UWP] Switching through the cells throws KeyNotFoundException.

Regards,
Stefan Nenchev
Progress Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Valentin
Top achievements
Rank 1
answered on 19 Sep 2018, 03:26 PM
Thank you Stefan, look forward to the fix.
0
Valentin
Top achievements
Rank 1
answered on 30 Sep 2018, 09:24 PM
Stefan, does this bug report qualify for points?
0
Stefan Nenchev
Telerik team
answered on 01 Oct 2018, 12:55 PM
Hi, Valentin,

I have updated your points for the report.

Have a great week.

Regards,
Stefan Nenchev
Progress Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
Calendar & Scheduling
Asked by
Valentin
Top achievements
Rank 1
Answers by
Valentin
Top achievements
Rank 1
Didi
Telerik team
Stefan Nenchev
Telerik team
Share this question
or