Calendar crash on UWP when clicking around to change the date

12 posts, 1 answers
  1. Valentin
    Valentin avatar
    25 posts
    Member since:
    Jun 2018

    Posted 22 Aug Link to this post

    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?

  2. Valentin
    Valentin avatar
    25 posts
    Member since:
    Jun 2018

    Posted 22 Aug in reply to Valentin Link to this post

    Forgot to mention I'm using the latest update 2018_2_821_1.
  3. Didi
    Admin
    Didi avatar
    93 posts

    Posted 28 Aug Link to this post

    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
  4. Valentin
    Valentin avatar
    25 posts
    Member since:
    Jun 2018

    Posted 28 Aug in reply to Didi Link to this post

    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?

  5. Didi
    Admin
    Didi avatar
    93 posts

    Posted 31 Aug Link to this post

    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
  6. Valentin
    Valentin avatar
    25 posts
    Member since:
    Jun 2018

    Posted 04 Sep in reply to Didi Link to this post

  7. Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    657 posts

    Posted 07 Sep Link to this post

    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
  8. Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    657 posts

    Posted 19 Sep Link to this post

    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
  9. Answer
    Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    657 posts

    Posted 19 Sep Link to this post

    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
  10. Valentin
    Valentin avatar
    25 posts
    Member since:
    Jun 2018

    Posted 19 Sep in reply to Stefan Nenchev Link to this post

    Thank you Stefan, look forward to the fix.
  11. Valentin
    Valentin avatar
    25 posts
    Member since:
    Jun 2018

    Posted 30 Sep in reply to Stefan Nenchev Link to this post

    Stefan, does this bug report qualify for points?
  12. Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    657 posts

    Posted 01 Oct Link to this post

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