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

DataSeries.CopyTo

1 Answer 60 Views
DomainDataSource
This is a migrated thread and some comments may be shown as answers.
Bryan
Top achievements
Rank 1
Bryan asked on 06 Jun 2011, 09:08 PM
I can't seem to get the CopyTo method to work on a ChartArea.DataSeries.  Unless I'm missing something the documentations says you can use a System.Array, however the compiler in VS2010 does not agree.  The compiler suggest using Telerik.Windows.Controls.Cahrting.DataSeries[], however when I try that I either get an error because the array is not initialized or if set to null a runtime exception is thrown. 

Here is what I've been trying

System.Array[] dsArray;
radChart.DefaultView.ChartArea.DataSeries.CopyTo(dsArray,0);  - Compile Error

or

DataSeries[] dsArray = null;
radChart.DefaultView.ChartArea.DataSeries.CopyTo(dsArray,0); - Runtime Error

Thanks for anyones help in this matter.
B. Ruggeri

1 Answer, 1 is accepted

Sort by
0
Bryan
Top achievements
Rank 1
answered on 06 Jun 2011, 09:23 PM
I might have found a solution, I have tried the following and at least it compiles and runs, now I just need to read each datapoint in the series and I'll have accomplished what I set out to do.

DataSeries[] dsArray = new DataSeries[radChart.DefaultView.ChartArea.DataSeries.Count];
radChart.DefaultView.ChartArea.DataSeries.CopyTo(dsArray,0);

B. Ruggeri
Tags
DomainDataSource
Asked by
Bryan
Top achievements
Rank 1
Answers by
Bryan
Top achievements
Rank 1
Share this question
or