protected void Page_Load(object sender, System.EventArgs e)
{
for (int i = 0; i <= GridView1.Rows.Count - 1; i++) {
Label lbl = default(Label);
lbl = (Label)GridView1.Rows(i).FindControl("lblUsername");
if ((lbl.Text.Equals("something"))) {
GridView1.Rows(i).Cells(0 - Index of your Edit Command Button).Visible = false;
}
}
}