Error when click on datagridview contain data...(Row, Cells, Header)
I don't understand error!
I think problem is here in the below code...
private void CreateTable(DataGridView grdvTest, ref DataTable table)
if (dgvResults.CurrentRow.Cells.Value != null)
int num = 0;
while (num < grdvTest.ColumnCount)
foreach (DataGridViewRow row in (IEnumerable)grdvTest.Rows)
DataRow row2 = table.NewRow();
for (num = 0; num < row.Cells.Count; num++)
if (row.Cells[num].Value != null)
row2[num] = row.Cells[num].Value.ToString().Replace(" ", " ");
row2[num] = "";
My app: Search google => fill to datagridview => Click => Error!
here my project with C#: http://www.mediafire.com/download.php?g7vtz2973g4h59r
Try debugging and stepping through your source code.
It should lead you to the line that could actually be throwing the error.
Note that the problem could not be in the same line but in the way you are populating this data.
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)