Hi,
I have a gridview which is being populated with no problems.
I want to be able to reference the data from the cells in the row
Can anyone provide me with the code that will allow me to access the
data in each cell.
Hi,
I have a gridview which is being populated with no problems.
I want to be able to reference the data from the cells in the row
Can anyone provide me with the code that will allow me to access the
data in each cell.
// Copy the items in the Rows collection into an array.
GridViewRow[] rowArray = new GridViewRow[gv.Rows.Count];
gv.Rows.CopyTo(rowArray, 0);
// Iterate though the array and display the value in the first cell of the row.
int j = -1;
foreach (GridViewRow row in rowArray)
{
j++;
if (j == idx)
{
Label1.Text = row.Cells[1].Text;
}
}
You can do it simply by using this given code.
dim string1 as string
string1 = gridview1.rows(row#).cells(cell#).text.tostring
Bookmarks