Page 1 of 1

Need help accessing properties.

Posted: Fri Jan 18, 2013 8:36 pm
by 15661467
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

Re: Need help accessing properties.

Posted: Mon Jan 21, 2013 10:36 am
by 10050769
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,

Re: Need help accessing properties.

Posted: Mon Jan 21, 2013 4:09 pm
by 15661467
Thank you Sandra, that was exactly what I needed.

Brian

Re: Need help accessing properties.

Posted: Tue Jan 22, 2013 9:29 am
by 10050769
Hello Brian,

I am glad that suggestion helps you :).

Thanks,