I was able to create RadCharts dynamically in code in the prior version of the control. I upgraded to the latest version of the RadChart, (install is: RadControls_for_ASP.NET_AJAX_2008_1_415_dev.exe), and now it does not work at all. I get a NullReferenceException when trying to use my chart variable. My code is:
Dim radchart As Telerik.Charting.Chart
Dim chartSeries As New ChartSeries()
chartSeries.Name =
"Count of Answers"
chartSeries.Type = ChartSeriesType.Bar
Dim answersForQuestion As System.Data.DataSet = GetReportDataForQuestion(questionID)
For currentRow = 0 To answersForQuestion.Tables(0).Rows.Count - 1
Dim answerCount As Integer = answersForQuestion.Tables(0).Rows(currentRow).Item("CountOfAnswer")
Dim answerText As String = answersForQuestion.Tables(0).Rows(currentRow).Item("AnswerText")
chartSeries.AddItem(answerCount, answerText)
Next
radchart.Series.Add(chartSeries) <-- Exception occurs here.
Could you please tell me how I can dynamically add a Chart using the latest version of the control?