none
Attempted to access an element as a type incompatible with the array

    Question

  • Hi

    I have a VS2005 app using MS Chart Controls which I am triying to migrate to VS2010 but it is giving me an error 'Attempted to access an element as a type incompatible with the array'. What do I need to do?

    ...
    Series S0 = new Series();
    S0.Name = "S0";
    S0.Points.DataBindXY(xArrayName, yArrayValue);
    for (int i = 0; i < S0.Points.Count; i++)
    {
        S0.Points[i].Color = Charts.GetSegmentColour(S0, i, TrenchID);
    }
    S0.ChartType = sct;
    S0["PieLabelStyle"] = "Outside";
    S0["PieLineColor"] = "#cccccc";
    Chart1.Series.Add(S0); this point is where the above error is thrown.
    ...

    Thanks, Peter

    Saturday, September 10, 2011 5:48 PM

All replies

  • Further to this I have found it works fine if the .cs file is in the web apps App_code directory rather than in a separate class library. Any ideas anyone?

    Peter

    Tuesday, September 13, 2011 4:21 PM