Hey,
I am evaluating the telerik chart component (trial version) for its suitability for our software project, and can not bring the RadCartesianChart to work.
I am trying to put a new view atop of an existing viewmodel, and bind the chart data to a property of type ObeservableCollection<KeyValuePair<int, double>>. When the collection is empty its ok, but when trying to populate it, I get
ArgumentException: Dynamic getter is not supported for value types.
Any idea why this happens and what the solution is?
My code: View:
And the view model:
I am evaluating the telerik chart component (trial version) for its suitability for our software project, and can not bring the RadCartesianChart to work.
I am trying to put a new view atop of an existing viewmodel, and bind the chart data to a property of type ObeservableCollection<KeyValuePair<int, double>>. When the collection is empty its ok, but when trying to populate it, I get
ArgumentException: Dynamic getter is not supported for value types.
Any idea why this happens and what the solution is?
My code: View:
<telerik:RadCartesianChart Grid.Row="1"> <telerik:RadCartesianChart.HorizontalAxis> <telerik:LinearAxis/> </telerik:RadCartesianChart.HorizontalAxis> <telerik:RadCartesianChart.VerticalAxis> <telerik:LinearAxis/> </telerik:RadCartesianChart.VerticalAxis> <telerik:RadCartesianChart.Series> <telerik:ScatterLineSeries XValueBinding="Key" YValueBinding="Value" ItemsSource="{Binding Path=DataSeries}"> </telerik:ScatterLineSeries> </telerik:RadCartesianChart.Series> </telerik:RadCartesianChart>And the view model:
// populated in Constructor private ObservableCollection<KeyValuePair<int, double>> mTempRandomData = new ObservableCollection<KeyValuePair<int, double>>(); private ObservableCollection < KeyValuePair <int, double> > mDataSeries = new ObservableCollection < KeyValuePair < int, double > > (); public ObservableCollection<KeyValuePair<int, double>> DataSeries { get { return mDataSeries; } set { mDataSeries = value; RaisePropertyChanged ( ()=>DataSeries ); } } private void DoResetData ( ) { DataSeries = new ObservableCollection < KeyValuePair < int, double > > (); } private void DoAddRandomData() { DoResetData ( ); DataSeries = mTempRandomData; }