In a test app I was building I came across this error when trying to draw the chart. I have some pseudo-randomly generated data that crashes my test app when trying to draw the Gantt chart...
System.ArgumentOutOfRangeException was unhandled HResult=-2146233086 Message=Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index ParamName=index Source=mscorlib StackTrace: at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource) at Steema.TeeChart.Styles.Gantt.CopyNextTasks() at Steema.TeeChart.Styles.Gantt.Draw() at Steema.TeeChart.Styles.Series.DrawSeries() at Steema.TeeChart.Chart.DoDraw(Graphics3D g, Int32 First, Int32 Last, Int32 Inc) at Steema.TeeChart.Chart.DrawAllSeries(Graphics3D g) at Steema.TeeChart.Chart.InternalDraw(Graphics g, Boolean noTools) at Steema.TeeChart.Chart.InternalDraw(Graphics g) at Steema.TeeChart.TChart.Draw(Graphics g) at Steema.TeeChart.TChart.OnPaint(PaintEventArgs pe) at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer) at System.Windows.Forms.Control.WmPaint(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) InnerException:
It appears to be way down in the TeeChart Gantt chart drawing logic.
My project is here: https://www.dropbox.com/sh/haqspd4ux41n2uf/AADkj2H5GLd09oJTW-HrAVr3a?dl=0
if anyone wants to reproduce it.
This test code did used to execute correctly with old 2.0.2670.26520 version of TeeChart.
Seems like my error might be related to the one described here: Exception and endlessly growing designer generated code in InitializeComponent when using Steema TeeChart for .NET 2013 4.1.2013.05280 - What to do?
Any ideas or suggestions on getting around it would be much appreciated.