Need help accessing properties.

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
brotsten
Newbie
Newbie
Posts: 4
Joined: Thu Feb 02, 2012 12:00 am

Need help accessing properties.

Post by brotsten » Fri Jan 18, 2013 8:36 pm

I'm new to C# and I'm having a problem accessing some series properties.

This works fine where I already have a statically defined series:

private void PointsCheckBox_CheckedChanged(object sender, EventArgs e)
{
this.line1.Pointer.Visible = this.PointsCheckBox.Checked;
}

Later during execution, I add some more series to the chart. I would like to set the property as above, Pointer.Visible, but it's not available:

private void PointsCheckBox_CheckedChanged(object sender, EventArgs e)
{
foreach (int i in this.theLargeChart.Series)
{
this.theLargeChart.Series.
Pointer.Visible = this.PointsCheckBox.Checked;
} ................................^^^^^^^This property is not visible here.
}


Could someone show me how I can access that property?

Thanks,

Brian

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Need help accessing properties.

Post by Sandra » Mon Jan 21, 2013 10:36 am

Hello Brian,

Your problem is produced because, not all series have the pointer property. For this reason to access pointer property, you must define the type of series as you are using as do in next line of code:

Code: Select all

(Chart1.Series[i] as Steema.TeeChart.Styles.Line).Pointer.Visible= true;
Could you tell us if previous code works in your end?

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

brotsten
Newbie
Newbie
Posts: 4
Joined: Thu Feb 02, 2012 12:00 am

Re: Need help accessing properties.

Post by brotsten » Mon Jan 21, 2013 4:09 pm

Thank you Sandra, that was exactly what I needed.

Brian

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Need help accessing properties.

Post by Sandra » Tue Jan 22, 2013 9:29 am

Hello Brian,

I am glad that suggestion helps you :).

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply