Hi,
In such cases we know number of
cell
in
gridview
but we dont know no of rows in the
gridview
, assuming we have three cells in each row then values from these
cells
can get like below
foreach (DataGridViewRow dr in dataGridView.Rows)
{
string cell1 = dr.Cells["cell1"].Value.ToString();
string cell2 = dr.Cells["cell2"].Value.ToString();
string cell3 = dr.Cells["cell3"].Value.ToString();
}
Here
cell1
,
cell2
and
cell3
are the Ids of gridview cells.
hope this help you.