Index was outside the bounds of the array.

Jul 20 2006 4:01 PM
All,

When it hits the Bold line, I get the error, Index was outside the bounds of the array.
Anyone know what I need to know.
Thanks
Guha
<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>

DataGridViewCell[,] cells = new DataGridViewCell[15, 1];
foreach (DataGridViewCell cell in selectedCells)
{
cells[0, 1].Value = cell.value;

}

Answers (8)