How to hide a linkbutton within a gridview?

1 reply. Last post: August 24, 2012 2:29 AM by Bernard Xiang
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback

Hi I have a gridview and I need to hide a linkbutton I have the following code but it takes only the first row and the other not hidden.
protected void grdContratos_InitializeRow(object sender, ISNet.WebUI.WebGrid.RowEventArgs e)
{
Label lbl = (Label)this.grdContratos.FindControl("lblEstado");
LinkButton lbtn2 = (LinkButton)this.grdContratos.FindControl("lnkAnexo");
if (lbl.Text == "Con firma")
{
lbtn2.Visible = false;
lblMensaje.Text = "favor de contactar a su ejecutivo de cuenta";
lblMensaje.Visible = true;

}
else
{
lbtn2.Visible = true;
}
Any suggestions? greetings.

All times are GMT -5. The time now is 4:47 PM.
Previous Next