changing shapestyle causes null reference exception

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
SteveR
Newbie
Newbie
Posts: 6
Joined: Tue May 06, 2003 4:00 am

changing shapestyle causes null reference exception

Post by SteveR » Tue Feb 15, 2005 1:21 pm

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

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Wed Feb 16, 2005 4:38 pm

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;
}

SteveR
Newbie
Newbie
Posts: 6
Joined: Tue May 06, 2003 4:00 am

Post by SteveR » Mon Feb 28, 2005 8:51 am

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

SteveR
Newbie
Newbie
Posts: 6
Joined: Tue May 06, 2003 4:00 am

Post by SteveR » Mon Feb 28, 2005 1:57 pm

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

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Thu Mar 10, 2005 10:08 am

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.

Post Reply