I would like to try plotting x and multiple y data from data residing in DataGridView. I populate datagridview but have no idea how to handle an event to get it plotted. I am using windows forms. I am trying to plot via OnPaint but there is no plot. Here is the relevant part:

protected override void OnPaint(PaintEventArgs e)
{

ds = new DataSeries();
ds.LineStyle.LineColor = Color.Red;
ds.LineStyle.Thickness = 2f;
ds.LineStyle.Pattern = DashStyle.Dash;
ds.SeriesName = "sine";
for (int i = 0; i < dataGridView1.RowCount; i++)
{
string value1 = dataGridView1[0, i].Value as string;
string value2 = dataGridView1[1, i].Value as string;
if (value1 != null && value2 != null)
{
float x = Convert.ToSingle(
(string)dataGridView1[0, i].Value);
float y = Convert.ToSingle(
(string)dataGridView1[1, i].Value);
ds.AddPoint(new PointF(x, y));
}
}
//e.Graphics.DrawLines(Pen, PointF(x,y));
base.OnPaint(e);
}

and DataSet:

namespace Example8_3
{
public class DataSeries
{
private ArrayList pointList;
private LineStyle lineStyle;
private string seriesName = "Default Name";

public DataSeries()
{
lineStyle=new LineStyle();
pointList=new ArrayList();
}

public LineStyle LineStyle
{
get { return lineStyle; }
set { lineStyle = value; }
}

public string SeriesName
{
get { return seriesName; }
set { seriesName = value; }
}

public ArrayList PointList
{
get { return pointList; }
set { pointList = value; }
}

public void AddPoint(PointF pt)
{
pointList.Add(pt);
}
}
}