Cannot read the first two columns of a row in a gridview
I need to read the allcolumns of a row in a gridview. I use the following
code to do so.
foreach (GridViewRow row in gridvw.Rows)
{
DataRow dr;
dr = table.NewRow();
//string str = gridvw.Rows(0).Cells(0).Text;
for (int i =0; i <; row.Cells.Count-1; i++)
{
dr[i] = row.Cells[i].Text.Replace("&nbsp;",
" ");
}
table.Rows.Add(dr);
}
Am adding all the values to a table. The above code returns nothing for
the first 2 columns of each and every row.
Can anybody help on this issue?
Thanks in Advance,
Joseph
No comments:
Post a Comment