try this
protected void GridView2_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
string text = e.Row.Cells[1].Text;
HyperLink hl = e.Row.FindControl("Hyperlink1") as HyperLink;
if (hl != null)
{
if (text == "ATP")
hl.NavigateUrl = "~/Reports/LabDetail/ATPDetails.aspx";
else if (text == "Water")
hl.NavigateUrl = "~/Reports/LabDetail/WaterDetails.aspx";
}
}
}