DataSeries.CopyTo

2 posts, 0 answers
  1. Bryan
    Bryan avatar
    3 posts
    Member since:
    Sep 2010

    Posted 06 Jun 2011 Link to this post

    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
  2. Bryan
    Bryan avatar
    3 posts
    Member since:
    Sep 2010

    Posted 06 Jun 2011 Link to this post

    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
  3. DevCraft banner
Back to Top