Solved

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

Posted on 2010-08-27
2
438 Views
Last Modified: 2012-06-21
I need show/hide a label control inside gridview column template, how can access from aspx.vb code.
0
Comment
Question by:rflorencio
2 Comments
 
LVL 20

Assisted Solution

by:informaniac
informaniac earned 100 total points
ID: 33542503
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
 
LVL 3

Accepted Solution

by:
raaziq earned 400 total points
ID: 33543576
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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now