Bilal Salas

Bilal Salas

  • NA
  • 21
  • 0

datagrideview exception

Jun 16 2010 5:55 AM
Hi,
for (int i = 0; i < dataGridView1.Rows.Count; i++)
{
new Thread((ThreadStart)delegate { GetProxies(dataGridView1.Rows[i].Cells[0].Value.ToString()); }).Start();
}

suppose datagrideview.rows.count=4
in the previews code when i counter is 4 exception raised

exception message"
"Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index"

but when I make the upper bounder of the conditiion is datagrideview.rows.count-1 it works but the last item in the dataviewgrid doesn't send to thread

what is the problem?


thanx alot

Answers (2)