try this:
foreach(GridViewRow row in GridView1.Rows) {
if(row.RowType == DataControlRowType.DataRow) {
HyperLink myHyperLink = row.FindControl("HyperLink2") as HyperLink;
myHyperLink.Visible = false;
}
}
or:
for (int i = 0; i < GridView1.Rows.Count; i++)
{
HyperLink myHyperLink = (HyperLink)gvExcParts.Rows[i].FindControl("HyperLink2");
myHyperLink.Visible = false;
}
but make sure bind data to gride view then find controls inside it, otherwise this will not work.