We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Can't get data binding to work.

Thread ID:





121100 Nov 10,2015 05:40 PM UTC Nov 17,2015 08:57 AM UTC ASP.NET Web Forms 3
Tags: Chart
James Butler
Asked On November 10, 2015 05:40 PM UTC

I am trying to use the data binding per the help file in Chart/Working with data but it isn't working.
I get this error message. 
Error 20 System.Collections.Generic.List`1[[Syncfusion.JavaScript.DataVisualization.Models.Series, Syncfusion.EJ, Version=13.3450.0.7, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89]] must have items of type 'Syncfusion.JavaScript.DataVisualization.Models.Series'. 'ej.Series' is of type 'System.Web.UI.HtmlControls.HtmlGenericControl'.

 Below is my code:

ASPX file;
<ej:Chart ID="Chart1" runat="server" Width="485" Height="300" CanResize="true" OnClientSeriesRendering="seriesRender" 
        Depth="100" WallSize="2" Tilt="0" Rotation="34" PerspectiveAngle="90" EnableRotation="true" Enable3D="true">
           <CommonSeriesOptions Type="Column" />

                <ej.Series Name="2012" XName="Xvalue" YName="YValue1"></ej.Series>
CS code in page load;

            SqlCommand command = DataAccess.GetSqlCommand(ref connection, commandText);

            command.CommandType = CommandType.Text;

            SqlDataAdapter adapter = DataAccess.GetSqlDataAdapter(ref command);

            DataSet data = new DataSet();
            int i = 0;


            List<ChartData> chartData = new List<ChartData>();

            for (i = 0; i <= data.Tables[0].Rows.Count - 1; i++)

                chartData.Add(new ChartData("IAPD 2012",(decimal)data.Tables[0].Rows[i].ItemArray[0]));
                chartData.Add(new ChartData("IAPD 2013",(decimal)data.Tables[0].Rows[i].ItemArray[1]));
                chartData.Add(new ChartData("IAPD 2014",(decimal)data.Tables[0].Rows[i].ItemArray[2]));
                chartData.Add(new ChartData("IAPD 2015",(decimal)data.Tables[0].Rows[i].ItemArray[3]));
                chartData.Add(new ChartData("IAPD 2016",(decimal)data.Tables[0].Rows[i].ItemArray[4]));
                chartData.Add(new ChartData("IAPD 2017",(decimal)data.Tables[0].Rows[i].ItemArray[5]));
                chartData.Add(new ChartData("IAPD 2018",(decimal)data.Tables[0].Rows[i].ItemArray[6]));
                chartData.Add(new ChartData("IAPD 2019",(decimal)data.Tables[0].Rows[i].ItemArray[7]));

            for (i = 0; i <= chartData.Count - 1; i++)
                Debug.WriteLine(chartData[i].Xvalue + " - $" + chartData[i].YValue1);


            this.Chart1.DataSource = chartData;
        catch (Exception ex)
            Debug.WriteLine("An error occured! " + ex.Message);

public class ChartData
        public ChartData(string xval, decimal yvalue1)
            this.Xvalue = xval;
            this.YValue1 = yvalue1;

        public string Xvalue

        public decimal YValue1
    } // end class ChartData

Sanjith Kesavan [Syncfusion]
Replied On November 11, 2015 07:26 AM UTC

Hi James Butler,

Thanks for contacting Syncfusion support. We have analyzed your query and used the code example provided by you in our sample. We can able to reproduce the exact issue mentioned by you. While analyzing your code we found that inside the series tag you have used <ej.Series> for defining the series. Instead of that please use <ej:Series> for defining the series. Please find the following code example


In the above code example we have done the suggested modification. Now the chart is rendering correctly.

We have modified the sample as per your requirement. Please find the sample from below mentioned location.

Sample Link: http://www.syncfusion.com/downloads/support/forum/121100/ze/Databinding2040171717


Please let us know if you have any concern.


Sanjith K.

James Butler
Replied On November 16, 2015 04:16 PM UTC

Thanks, I guess all I needed was an extra pair of eyes that could see the problem.
Those little things are the ones that really get you.

Sanjith Kesavan [Syncfusion]
Replied On November 17, 2015 08:57 AM UTC

Hi James Butler,


We are glad that your issue has been resolved. Feel free to contact us any time if you face any other issues.



Sanjith K.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon