In rowdatabound:
protected void grvOutput_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
string id = e.Row.Cells[0].Text;
}
}
Or, for single click/selection, you could use SelectedIndexChanged
protected void grvOutput_SelectedIndexChanged(object sender, EventArgs e)
{
string id = grvOutput.SelectedRow.Cells[0].Text;
}