I installed the new release of the WPF controls yesterday, and everything seemed fine at first. But I'm encountering an incredibly frustrating and weird error. I have a combo box where users can select different chart types. My code will then redraw the chart, recreating all of the series and adding the new chart type to the series accordingly. But every other time I try to change the chart type it errors at the point where I do the xamChart.Series.add(chartSeries); saying "object reference not set to an instance of an object"...
But the thing is, the xamChart object that I'm adding the series to is not null, and neither is the series object that I'm passing in. This didn't happen with the previous control, and after it has errored, if I try ot change the chart type again then it's fine. Then next change, it will break again, and so on...
I've included the stack trace from the exception below:
at Infragistics.Windows.Chart.Series.GetIChart() at Infragistics.Windows.Chart.ChartSeries.GetChartAttribute(ChartTypeAttribute parameter, Series series) at Infragistics.Windows.Chart.DataPoint.IsColorFromPoint(Series series) at Infragistics.Windows.Chart.DataPoint.GetFill(Int32 seriesIndex, Int32 pointIndex) at Infragistics.Windows.Chart.StackedCylinderChart3D.Draw3D(Model3DGroup model3DGroup, RotateTransform3D rotateTransform3D) at Infragistics.Windows.Chart.PlottingPane3D.Draw() at Infragistics.Windows.Chart.ScenePane.Create3DScene() at Infragistics.Windows.Chart.ScenePane.DrawWithException() at Infragistics.Windows.Chart.ScenePane.Draw() at Infragistics.Windows.Chart.ChartCreator.Create3DChart() at Infragistics.Windows.Chart.Chart.RefreshWithException() at Infragistics.Windows.Chart.Chart.Refresh() at Infragistics.Windows.Chart.XamChart.Refresh() at Infragistics.Windows.Chart.SeriesCollection.OnCollectionChanged(NotifyCollectionChangedEventArgs e) at System.Collections.ObjectModel.ObservableCollection`1.InsertItem(Int32 index, T item) at Infragistics.Windows.Chart.SeriesCollection.InsertItem(Int32 index, Series item) at System.Collections.ObjectModel.Collection`1.Add(T item)
Please help as I don't want to have to stop using the controls.
Hi rp8049,
Could you please provide a sample demonstrating the error that you get.
Sincerely,
Horen Kirazyan
Software Engineer in Test
I will try to put something together in the next week or two. Unfortunately things are very busy at the moment so I don't have the time to put together an example, but I will let you know once I've managed to get one together.