Solved

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

Posted on 2010-08-27
2
441 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

912 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

22 Experts available now in Live!

Get 1:1 Help Now