Add a label to your gridview's column as itemtemplate. Set its text to the ID and keep this label invisible. Now on RowDataBound event of your gridview write:
protected void YourGridView_RowDataBound(object sender, GridViewRowEventArgs e) {
if(e.Row.RowType == DataControlRowType.DataRow)
{
Label lbl = (Label)e.Row.FindControl("yourLabelsID
string ID = lbl.Text.Trim();
e.Row.Attributes.Add("onclick","top.location.href='YourRedirectPage.aspx?id=" + ID + "';");
}
}