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

Behaviors causing exception

4 Answers 39 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Bill
Top achievements
Rank 1
Bill asked on 17 May 2018, 12:06 PM

I have started getting the following error on a page with a chart present:

(29060): Assembly Ref addref Telerik.XamarinForms.Chart[0xab4fc630] -> System[0xab814130]: 14
Unhandled Exception: System.ArrayTypeMismatchException: Attempted to access an element as a type incompatible with the array.

This happens on the InitializeComponent() call in the page constructor. The problem seems to be with the Behaviors, when I remove the following lines from my XAML, the exception doesn't happen:

<telerikChart:RadCartesianChart.Behaviors>
  <telerikChart:ChartPanAndZoomBehavior ZoomMode="Both" PanMode="Both"/>
  <telerikChart:ChartTrackBallBehavior x:Name="BallBehavior" ShowIntersectionPoints="True" ShowTrackInfo="True" />
</telerikChart:RadCartesianChart.Behaviors>

I'm using the latest versions of xamarin.forms [3.0.0.482510] and the telerik controls [2018.2.516.0] (both updated in my project today).

4 Answers, 1 is accepted

Sort by
0
Lance | Manager Technical Support
Telerik team
answered on 17 May 2018, 05:38 PM
Hi Bill,

Can you confirm whether or not you have any series in the chart at the time of the ContentPage's instantiation? 

Regards,
Lance | Tech Support Engineer, Sr.
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
Bill
Top achievements
Rank 1
answered on 18 May 2018, 09:16 AM
The series isn't set until the end of OnAppearing. I did find a workaround - setting the behaviors in the constructor works without issues.
0
Stefan Nenchev
Telerik team
answered on 23 May 2018, 07:35 AM
Hi, Bill,

We were able to reproduce the behavior in a Xamarin.Forms 3.0 setup. However, we are not officially supporting the 3.0 version, though we hope to be able to confirm this soon with another release. We will consider the scenario you have as well.  I am glad to see you found a workaround at this point.

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 28 May 2018, 11:36 AM
Hi, Bill,

We have logged the behavior as a bug in our internal system. You can track it on the following link from our Ideas & Feedback portal - Chart: [XF 3.0]Adding behaviors through XAML results in System.ArrayTypeMismatchException. Please subscribe to the item so that you are automatically notified when there is any progress on the matter. I have added 1000 points to your account for reporting the behavior as well.

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
Chart
Asked by
Bill
Top achievements
Rank 1
Answers by
Lance | Manager Technical Support
Telerik team
Bill
Top achievements
Rank 1
Stefan Nenchev
Telerik team
Share this question
or