asp.net vb.net how can acces label control inside gridview column template

I need show/hide a label control inside gridview column template, how can access from aspx.vb code.
rflorencioAsked:
Who is Participating?
 
raaziqConnect With a Mentor Commented:
u can use the gridview RowDatabound event,

 protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        {
              Label lbl = e.Row.FindControl("Label1");
        }


u can set its visibility frm here based on any conditions. it occurs during the binding of each rows of the gridview.

cheers.
0
 
informaniacConnect With a Mentor Commented:
I'm not sure of vb but in C# it's like this

Label lblName = Gv.Rows[0].FindControl("lblName") as Label;
lblName.Visible = false;
0
All Courses

From novice to tech pro — start learning today.