Jump to content
Software FX Community

ListProvider working sporadically


Recommended Posts


I'm using the listprovider to pass 7 data series to my chart.  The code/app works fine, i.e. I see the data I expect to see in the charts/panes I expect them to be in. 

However sometimes I'll run the app, and for some reason the code exceptions out with an index out of range error.  I've tracked this error down and discovered that sometimes the chart will show the series count as 0 (I.e. the Series property), even though the listprovider shows it has the 7 data series in it.  Additionally, sometime the chart Series property will show a Count of 0, but when I drill down into the Series, it shows a count of 7.  What is going on here?

 FWIW I've run the app only in the debugger.  Also I am programatically building the data series and the listProvider, i.e. there is no datasource associated with the chart at design time


Thanks for any help you can provide



Link to comment
Share on other sites


thanks very much.  I do have proprietary code in the project so I need to remove that code.  FWIW the problem occurs before any of the proprietary code is touched, so removing this code shouldn't have an impact (I'll verify of course).  So give me .5 hr and I'll send the project (VS 2005 project).  In the meantime, here is a screen print of the problem in the debugger.

 As you can see in the screen print,

1.the ListProvider object has 7 series attached to it.  (Each data series has only 1 element in it purposely).

2.And you can plainly see that the statement to attach the listProvider to the chart (chart1.DataSetting.DataSource = lstProvider. 

3.I have a breakpoint right after the above statement executed.

4.Take a look in the lower left hand corner.  I have the chart1.Series property displayed in the watch window.  It shows a count of 0!







Link to comment
Share on other sites


attached is the project that is incurring the problem.  Again the list provider has 7 data series in it, but after I attach the listProvider to the chart the code exceptions out at line 100 in the Form1.designer.cs code with an index out of range.  (FWIW the same problem has happened in other projects as well).  I've commented out any of my proprietary code and the problem still occurs.

Thanks in advance for any help/insight you guys can provide


Link to comment
Share on other sites

I was able to reproduce the problem in the sample program you sent.

There is a bug in Chart FX that's causing this problem, specifically related to the ListProvider. The Series collection is not properly initialized.

We will fix this in the next service pack, however, there is a easy workaround:

Force the series collection initialization before passing the data to the chart as follows:

object o = chart1.Series;

Do this right before adding the DataSource.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...