I am working on a windows form app with a zedgraph and a datagridview. The datagridview has a row for every point in the line graph, and when the user clicks on a point in the graph I want it to highlight the equivalent row in the datagridview.
So how can I find out which point the user has clicked? (I don't need any code for datagridview part).
I figured it out. You can use
GraphPane.FindNearestObject
to find the point that was clicked.It seems that
nearestObject
isnull
if you do not click a point and is of typeLineItem
if you do, and thenindex
will tell you which point was clicked.