HyperLink hyp = (HyperLink)Gridview1.Rows[Gridview1Row.RowIndex].Cells[columnEmployeeIndex].Controls[0];
emp = string.IsNullOrWhiteSpace(hyp.Text) ? 0 : Convert.ToInt32(hyp.Text);
Read more: http://feeds.dzone.com/~r/dzone/snippets/~3/NxJVM6tw4uk/14579