Page 1 of 1
changing shapestyle causes null reference exception
Posted: Tue Feb 15, 2005 1:21 pm
by 8120734
I have written a web application project that uses shape series (added to the chart at runtime). If I try to change the shape style (to any value even circle which it is by default). I get the following error.
[NullReferenceException: Object reference not set to an instance of an object.]
Steema.TeeChart.Styles.Shape.set_Style(ShapeStyles value) +14
This error occurred with version 1.1.1769.19457 as well as the latest version 1.1.1864.22788.
Have you seen this problem before?
Steve R
Posted: Wed Feb 16, 2005 4:38 pm
by Pep
Hi Steve,
using the following code works fine here :
Code: Select all
private void Button1_Click(object sender, System.EventArgs e)
{
(WebChart1.Chart.Series[0] as Steema.TeeChart.Styles.Shape).Style = Steema.TeeChart.Styles.ShapeStyles.Rectangle;
}
Posted: Mon Feb 28, 2005 8:51 am
by 8120734
Hi Josep
I moved the line which sets the shape style so that it was after the series has been added to the chart. Now it works OK but shouldn't it be possible to set the style at any time? If the style is set before adding the series to the chart then the null reference exception still occurs (in web and windows forms).
Anyway, it's working now - thanks for your help.
Steve
Posted: Mon Feb 28, 2005 1:57 pm
by 8120734
The null reference exception is fixed but now I notice a different problem. If I change the shape style from the default then my series click event doesn't fire! I can see it cause the postback but it doesn't get to my click event. Removing the style change makes everything work OK again (except the shape style is wrong of course). Any ideas?
Steve
Posted: Thu Mar 10, 2005 10:08 am
by Pep
Hi Steve,
yes, you're correct, it's a known bug (already down our defect list), the OnClick event is not working for some shape styles. We'll try to fix it for the next maintenance releases.