I want to find the control(hyperlink) in the gridview. Based on the value of the control I want to enable or disable the hyperlink. I tried like this. But I am always getting null.
protected void gridResult_RowDataBound(object sender, GridViewRowEventArgs e) {
if (e.Row.RowType == DataControlRowType.DataRow)
{
HyperLink status = e.Row.FindControl("id") as HyperLink;
if ( status != null && status.Text == "AAAA" ) {
status.Enabled = false;
}
}
}
Please help.