Completed
Last Updated: 03 Feb 2023 06:39 by ADMIN
Release LIB 2023.1.206 (6 Feb 2023)
Martin Ivanov
Created on: 12 Jan 2023 14:48
Category: ChartView
Type: Bug Report
0
ChartView: ArgumentException is thrown when the chart series is populated with items of type ICustomTypeProvider

ArgumentException occurs when the ItemsSource of the chart series is populated with items that implement the ICustomTypeProvider interface and the value binding properties of the series  (ValueBinding, CategoryBinding, YValueBinding, XValueBinding, etc.) are assigned to dynamic properties. This happens when the value binding properties are assigned to PropertyNameDataPointBinding object pointing to a property name. This is also what happens if you set the properties in XAML using string values.

To work this around, you can use the GenericDataPointBinding<T> class defined in code-behind in order to assign the value binding properties. 

Or alternatively, you can implement custom PropertyNameDataPointBinding class and override its GetValue() method. In the method, you can check the item type and if it is ICustomTypeProvider, and then execute custom code that gets the value. The custom PropertyNameDataPointBinding implementation is shown in the attached CustomPropertyNameDataPointBinding.zip file. To use the custom binding class in XAML, you can use the following syntax:

<telerik:ScatterPointSeries.YValueBinding>
	<local:CustomPropertyNameDataPointBinding PropertyName="Y" />
</telerik:ScatterPointSeries.YValueBinding>

0 comments