Cannot expose a Zedgraph property that I want to modify in real-time

42 views Asked by At

I have successfully changed the color of a Zedgraph LineItem at run-time with this line (zgc is my Zedgraph control):

zgc.MaterPane.PaneList[i].CurveList[j].Color = Color.Red;

However, I cannot figure out how to change the Symbol Type, because that property does not get exposed when I type this:

zgc.MaterPane.PaneList[i].CurveList[j].

When I put a breakpoint and do a "Add Watch" to look at the properties of (zgc.MaterPane.PaneList[i].CurveList[j]) the LineItem, I can see the Symbol property. So, why is it not getting exposed?

1

There are 1 answers

0
stil_e On

zgc.MaterPane.PaneList[i].CurveList[j] returns a CurveItem.

Cast it to LineItem to expose LineItem properties:

((LineItem)zgc.MaterPane.PaneList[i].CurveList[j]).Symbol