get GridViewRow using datakeynames value code example
Example: c# get gridview DataKeyNames
foreach (GridViewRow row in grid.Rows)
{
int id = Convert.ToInt32(grid.DataKeys[row.RowIndex].Value.ToString());
}
foreach (GridViewRow row in grid.Rows)
{
int id = Convert.ToInt32(grid.DataKeys[row.RowIndex].Value.ToString());
}